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

Closed
Luna-OS wants to merge 1 commit from upstream-pr/884 into main
Luna-OS commented 2026-11-24 14:55:27 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Luna-OS on 2026-11-24T14:55:27Z.


Claimed in the coordination issue as: TEST-GUEST-SCENE-LOCALE (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7135144377)

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

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5474565346 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/884). Originally posted by [Luna-OS](https://github.com/Luna-OS) on 2026-11-24T14:55:27Z. --- Claimed in the coordination issue as: TEST-GUEST-SCENE-LOCALE (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7135144377) ### 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)
LewisStephens99 commented 2026-11-24 15:06:54 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by LewisStephens99 on 2026-11-24T15:06:54Z.


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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7135481571 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/884#issuecomment-7135481571). Originally posted by [LewisStephens99](https://github.com/LewisStephens99) on 2026-11-24T15:06:54Z. --- 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.
MoonEyes commented 2026-11-24 16:05:42 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-24T16:05:42Z.

Review: APPROVED


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).

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6042881567 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/884#pullrequestreview-6042881567). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-24T16:05:42Z. **Review:** APPROVED --- 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).
aslan2142 commented 2026-11-24 18:17:56 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-11-24T18:17:56Z.


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://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7126627432
  • 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).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7140445366 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/884#issuecomment-7140445366). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-11-24T18:17:56Z. --- 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://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7126627432 - `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

Sign in to join this conversation.
No reviewers
No labels
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.

Reference
ProjectLeonida/mandy!884
No description provided.