Skip to content

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 into
ProjectLeonida:mainfrom
Luna-OS:fix/guest-scene-test-locale
Closed

Luna-OS wants to merge 1 commit into
ProjectLeonida:mainfrom
Luna-OS:fix/guest-scene-test-locale

Conversation

@Luna-OS

@Luna-OS Luna-OS commented Nov 24, 2026

Copy link
Copy Markdown

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

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

… on stdout (TEST-GUEST-SCENE-LOCALE)

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 <noreply@anthropic.com>
@LewisStephens99

Copy link
Copy Markdown

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 MoonEyes left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

  • 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

Copy link
Copy Markdown
Collaborator

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

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 aslan2142 closed this Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants