rdna2_tools_check: test_cli_scanner fails when PYTHONIOENCODING=utf-8 on a non-UTF-8 code page #844

Closed
opened 2026-11-26 22:22:47 +00:00 by github-bot · 0 comments
Owner

@⁠lukaslw-lab on GitHub · 2026-11-23 11:56 UTC · original

AI-assisted (Claude Code).

Commit or build

42154de (branch on main c3db335; tests/rdna2_tools_check.py and tools/scan_unsupported_shaders.py are unchanged from main)

Reproduction

$env:PYTHONIOENCODING = 'utf-8'
ctest --preset dev --no-tests=error -R '^rdna2_tools_check$' --output-on-failure

Expected behavior

Pass, as it does with the variable unset.

Observed behavior

test_cli_scanner errors. The reader thread raises UnicodeDecodeError: 'charmap' codec can't decode byte 0x88 in position 244, res.stdout is None, and assertIn at line 2464 raises TypeError.

Cause: with PYTHONIOENCODING=utf-8 the scanner's stdout is UTF-8, so make_progress_bar (encoding check from #241) prints █ (E2 96 88). The test runs it with text=True and no encoding, so the parent decodes in the locale encoding (cp1250 here). Both scanner calls in test_cli_scanner are affected.

Suggested fix: pass encoding="utf-8" and env={**os.environ, "PYTHONIOENCODING": "utf-8"} to both calls, so the two sides agree whatever the caller's environment. #635 fixed the same class of issue for dependency_paths.py.

Environment

Windows 10 22H2 (19045), ANSI code page 1250, Python 3.13.7.

Checklist

  • I reproduced this on a source-built input.
  • I did not include game files, dumps, distribution links or credentials.
**@⁠lukaslw-lab** on GitHub · 2026-11-23 11:56 UTC · [original](https://github.com/R0Y00/Xbox2Windows/issues/844) _AI-assisted (Claude Code)._ ### Commit or build `42154de` (branch on `main` `c3db335`; `tests/rdna2_tools_check.py` and `tools/scan_unsupported_shaders.py` are unchanged from `main`) ### Reproduction ```powershell $env:PYTHONIOENCODING = 'utf-8' ctest --preset dev --no-tests=error -R '^rdna2_tools_check$' --output-on-failure ``` ### Expected behavior Pass, as it does with the variable unset. ### Observed behavior `test_cli_scanner` errors. The reader thread raises `UnicodeDecodeError: 'charmap' codec can't decode byte 0x88 in position 244`, `res.stdout` is `None`, and `assertIn` at line 2464 raises `TypeError`. Cause: with `PYTHONIOENCODING=utf-8` the scanner's stdout is UTF-8, so `make_progress_bar` (encoding check from #241) prints `█` (`E2 96 88`). The test runs it with `text=True` and no `encoding`, so the parent decodes in the locale encoding (cp1250 here). Both scanner calls in `test_cli_scanner` are affected. Suggested fix: pass `encoding="utf-8"` and `env={**os.environ, "PYTHONIOENCODING": "utf-8"}` to both calls, so the two sides agree whatever the caller's environment. #635 fixed the same class of issue for `dependency_paths.py`. ### Environment Windows 10 22H2 (19045), ANSI code page 1250, Python 3.13.7. ### Checklist - [x] I reproduced this on a source-built input. - [x] I did not include game files, dumps, distribution links or credentials.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 22:22:47 +00:00
This discussion has been locked. Commenting is limited to contributors.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/R0Y00--Xbox2Windows#844
No description provided.