tests: guest scene launch-failure test tolerates a localized OS error on stdout (TEST-GUEST-SCENE-LOCALE) #884

Closed
github-bot wants to merge 1 commit from gh-pr/884/head into gh-pr/884/base
Owner

@⁠Luna-OS on GitHub · 2026-11-24 14:55 UTC · original
Luna-OS:fix/guest-scene-test-locale → main · +2 −1 · 1 files · 1 commits · closed without merging

Claimed in the coordination issue as: TEST-GUEST-SCENE-LOCALE (#14)

What and why

tests/test_guest_scene_reference.py::test_launch_failure_preserves_run_record_and_logs errors on a non-English Windows:

TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'

scripts/run_guest_scene.py prints the OSError from launching the synthetic non-executable, and on a German Windows that text (WinError 216, with ü/ß) reaches stdout in the ANSI code page (cp1252). The test decoded stdout as strict UTF-8, so the reader thread failed and result.stdout became None. The neighbouring test in the same file already passes errors="replace"; this one now does the same. The runner itself was fine: exit 1, report.json and logs/full.json are written as the test expects.

Tested

On Windows 11 (de-DE locale), Python 3.13.7, no game files: python -I tests/test_guest_scene_reference.py, 6 OK (was 1 error).

GPUs tested: n/a

AI-assisted: yes (Claude Code)

Checklist

  • Based on current main and merges cleanly.
  • One topic.
  • No game data, keys or decryption.
  • No translator rule changed.

🤖 Generated with Claude Code

**@⁠Luna-OS** on GitHub · 2026-11-24 14:55 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/884) `Luna-OS:fix/guest-scene-test-locale` → `main` · +2 −1 · 1 files · 1 commits · closed without merging Claimed in the coordination issue as: TEST-GUEST-SCENE-LOCALE (https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14) ### What and why `tests/test_guest_scene_reference.py::test_launch_failure_preserves_run_record_and_logs` errors on a non-English Windows: ``` TypeError: unsupported operand type(s) for +: 'NoneType' and 'str' ``` `scripts/run_guest_scene.py` prints the `OSError` from launching the synthetic non-executable, and on a German Windows that text (`WinError 216`, with `ü`/`ß`) reaches stdout in the ANSI code page (cp1252). The test decoded stdout as strict UTF-8, so the reader thread failed and `result.stdout` became `None`. The neighbouring test in the same file already passes `errors="replace"`; this one now does the same. The runner itself was fine: exit 1, `report.json` and `logs/full.json` are written as the test expects. ### Tested On Windows 11 (de-DE locale), Python 3.13.7, no game files: `python -I tests/test_guest_scene_reference.py`, 6 OK (was 1 error). GPUs tested: n/a AI-assisted: yes (Claude Code) ### Checklist - [x] Based on current `main` and merges cleanly. - [x] One topic. - [x] No game data, keys or decryption. - [x] No translator rule changed. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
On a non-English Windows the WinError text reaches stdout in the ANSI code page;
strict UTF-8 decoding left result.stdout as None and the test died with a TypeError.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:26:19 +00:00
github-bot closed this pull request 2026-11-26 09:26:19 +00:00
Author
Owner

@⁠LewisStephens99 on GitHub · 2026-11-24 15:06 UTC · original

Independent verification on Windows 11, Python 3.14:n- python -I tests/test_guest_scene_reference.py: 6/6 passed.n`nNo game files or GPU used. AI-assisted.

**@⁠LewisStephens99** on GitHub · 2026-11-24 15:06 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/884#issuecomment-7135481571) Independent verification on Windows 11, Python 3.14:`n- `python -I tests/test_guest_scene_reference.py`: 6/6 passed.`n`nNo game files or GPU used. AI-assisted.
Author
Owner

@⁠MoonEyes on GitHub · 2026-11-24 16:05 UTC · original · approved these changes

LGTM. Reproduced on a French Windows 11, Python 3.14, no game files, main a28927849 vs this PR (700d6b4cb):

  • main: python -I tests/test_guest_scene_reference.py: 1 error, the same TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'.
  • this PR: 6/6 OK.
  • The result is the same with PYTHONUTF8=1 and =0, since -I ignores it in both the test and the child.

The cause is the one in the description, with a second locale. The child's stdout line is
FAIL: full: could not launch ...invalid.exe: [WinError 216] Cette version de %1 n\x92est pas compatible ... ex\xe9cut\xe9e.
That is cp1252 (0x92 is the right single quote, 0xe9 is é), and a strict UTF-8 decode fails at byte 0x92. errors="replace" matches the neighbouring test, and the assertions that matter (exit 1, report.json, logs/full.json) do not depend on that text.

AI-assisted: yes (Claude Code ran the measurements; I checked them).

**@⁠MoonEyes** on GitHub · 2026-11-24 16:05 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/884#pullrequestreview-6042881567) · **approved these changes** LGTM. Reproduced on a **French** Windows 11, Python 3.14, no game files, main a28927849 vs this PR (700d6b4cb): - main: `python -I tests/test_guest_scene_reference.py`: 1 error, the same `TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'`. - this PR: 6/6 OK. - The result is the same with `PYTHONUTF8=1` and `=0`, since `-I` ignores it in both the test and the child. The cause is the one in the description, with a second locale. The child's stdout line is `FAIL: full: could not launch ...invalid.exe: [WinError 216] Cette version de %1 n\x92est pas compatible ... ex\xe9cut\xe9e`. That is cp1252 (`0x92` is the right single quote, `0xe9` is `é`), and a strict UTF-8 decode fails at byte `0x92`. `errors="replace"` matches the neighbouring test, and the assertions that matter (exit 1, `report.json`, `logs/full.json`) do not depend on that text. AI-assisted: yes (Claude Code ran the measurements; I checked them).
Author
Owner

@⁠aslan2142 on GitHub · 2026-11-24 18:17 UTC · original

Thanks for the fix. I'm closing this as a duplicate of #586, which covers the same test and was claimed first:

  • kawaii-shakal claimed TEST-GSR-LOCALE in #14 at 08:50 UTC and opened #586 at 09:17 UTC: #14
  • TEST-GUEST-SCENE-LOCALE was claimed at 14:54 UTC, and this PR opened at 14:55 UTC.
  • AGENTS.md asks to check the open pull requests before claiming, and to stop if one already covers the item.
  • I checked #586: on a simulated cp1252 host, the test errors on main and passes with that PR, with its assertions unchanged.

If I missed an earlier claim of yours, say so here and I'll reopen it.

AI-assisted (Claude Code, Claude Opus 5.5).

**@⁠aslan2142** on GitHub · 2026-11-24 18:17 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/884#issuecomment-7140445366) Thanks for the fix. I'm closing this as a duplicate of #586, which covers the same test and was claimed first: - kawaii-shakal claimed `TEST-GSR-LOCALE` in #14 at 08:50 UTC and opened #586 at 09:17 UTC: https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14 - `TEST-GUEST-SCENE-LOCALE` was claimed at 14:54 UTC, and this PR opened at 14:55 UTC. - `AGENTS.md` asks to check the open pull requests before claiming, and to stop if one already covers the item. - I checked #586: on a simulated cp1252 host, the test errors on `main` and passes with that PR, with its assertions unchanged. If I missed an earlier claim of yours, say so here and I'll reopen it. AI-assisted (Claude Code, Claude Opus 5.5).

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.