From 0667ec19ebc673545dd9e950a5f0d6ee455ccba3 Mon Sep 17 00:00:00 2001 From: kawaii-shakal Date: Tue, 24 Nov 2026 13:54:41 +0500 Subject: [PATCH] tests: guest scene launch failure decodes a localized OS error (TEST-GSR-LOCALE) On a Windows host whose ANSI code page is not UTF-8 (1251 on a Russian install), run_guest_scene.py prints the "could not launch" line with the localized [WinError 216] text in that code page. The test decoded the child's output as strict UTF-8, so subprocess.run left result.stdout as None and the next line failed with a TypeError before any real assertion ran. Decode with errors="replace", as the output-directory case in the same file already does. Co-Authored-By: Claude Opus 5.5 --- tests/test_guest_scene_reference.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/test_guest_scene_reference.py b/tests/test_guest_scene_reference.py index 3c0ed16dd7..9c6df51f85 100644 --- a/tests/test_guest_scene_reference.py +++ b/tests/test_guest_scene_reference.py @@ -112,7 +112,9 @@ def test_launch_failure_preserves_run_record_and_logs(self): "--shaders", str(root), "--out", str(out)] if sys.platform != "win32": cmd += ["--wine", str(bad_loader), "--wine-arg=-a", "--wine-arg=path with spaces/wine"] - result = subprocess.run(cmd, capture_output=True, encoding="utf-8", timeout=20) + # The runner's "could not launch" line carries the OS error text, which Windows localizes and the child + # prints in the ANSI code page (cp1251 on a Russian host): a strict UTF-8 decode would leave stdout None. + result = subprocess.run(cmd, capture_output=True, encoding="utf-8", errors="replace", timeout=20) self.assertEqual(result.returncode, 1, result.stdout + result.stderr) report = json.loads((out / "report.json").read_text(encoding="utf-8")) self.assertIn("could not launch", report["error"])