mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #4679] [CLOSED] [Other] handle non-UTF-8 Windows subprocess output #5135
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#5135
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/4679
Author: @dannyward630
Created: 10/30/2026
Status: ❌ Closed
Base:
main← Head:fix/issue-4675-windows-output-encoding📝 Commits (1)
0eee988[Other] handle non-UTF-8 Windows subprocess output📊 Changes
5 files changed (+49 additions, -11 deletions)
View changed files
📝
setup.py(+5 -3)📝
strata_control/engine_component.py(+11 -7)📝
tests/terminal/test_engine_component.py(+18 -0)📝
tools/strata_mcp.py(+2 -1)📝
tools/test_setup_amd.py(+13 -0)📄 Description
Fixes #4675.
Problem and result
On a Chinese-locale Windows system, PowerShell emits OEM/GBK text. Python subprocess readers configured for UTF-8 can raise UnicodeDecodeError, terminate their reader threads, and leave callers with missing stdout. A replacement character in an adapter name can also block the existing name check from reaching the AMD registry's 64-bit VRAM value. This change makes subprocess decoding resilient, treats missing stdout as empty output, and keeps PCI-ID matching available when the adapter name is damaged.
Related discussion
#4675, a bug report. The reporter offered to test a patch on the affected Windows machine.
Approach
Use UTF-8 replacement decoding at the affected subprocess boundaries. Guard the affected output parsers against missing stdout. In AMD registry matching, preserve the name check for intact names and skip it only when the adapter name contains U+FFFD; PCI ID remains the required match.
AI assistance: Codex (GPT-6) assisted with implementation and regression tests.
Validation
Run against the PR tree on Windows with Python 3.11.9.
Passed:
python -m unittest tools.test_setup_amd— 55 tests passed.python -m pytest tests/terminal/test_engine_component.py -q— 41 passed, 2 skipped.git diff --checkpassed.Failed:
python -m unittest tools.test_strata_mcp -q— 52 tests ran; 4 failed and 2 errored in process cancellation/start-stop behavior. Those failures are outside the changed encoding paths by inspection; I did not run the base revision to establish whether they predate this patch.Not run:
python setup.py --checkandstrata launch. That hardware/locale environment is unavailable here. The issue reporter offered to run these checks; please share the results before this PR leaves draft.Limits
Replacement decoding can replace non-UTF-8 characters in subprocess text. PCI identifiers and other ASCII output remain intact, which is sufficient for the affected device detection paths.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.