From 6481434f1eedd2bc70567dd1f3fe2bf9a3747727 Mon Sep 17 00:00:00 2001 From: Lukas Geiger Date: Mon, 30 Nov 2026 09:09:02 +0100 Subject: [PATCH] test(windows): decode starter output with errors="replace" (OEM code page) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Unter einem deutschen Windows gibt `pause` in cmd.exe seinen Hinweis in der OEM-Codepage aus (cp850, „Drücken“ → 0x81). Der Test hat stdout als strenges UTF-8 dekodiert. Dabei ist der Lesethread von subprocess mit UnicodeDecodeError abgebrochen, communicate() lieferte stdout=None, und `"foreground" in stdout` warf „TypeError: argument of type 'NoneType' is not iterable“. Der Starter selbst war in Ordnung. Auf Linux-CI wird die Datei übersprungen (skipif os.name != "nt"). Fix: In beiden Aufrufen `errors="replace"` setzen. Geprüft werden nur ASCII-Marken („foreground“, Exitcode). Lokal unter Windows (ASUS-GEI, deutsche Codepage): - tests/test_multibot_windows.py vorher 2 failed, 3 passed, nachher 5 passed. - ruff format --check und ruff check sind sauber. T-20261130-910132249 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01THB2EzGbmyMB2S1P43LDZb --- tests/test_multibot_windows.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test_multibot_windows.py b/tests/test_multibot_windows.py index d82efba..d59d990 100644 --- a/tests/test_multibot_windows.py +++ b/tests/test_multibot_windows.py @@ -39,6 +39,7 @@ def test_success_and_failure_wait_for_key_then_keep_exitcode(tmp_path, code): stderr=subprocess.PIPE, text=True, encoding="utf-8", + errors="replace", # cmd.exe `pause` prints in the OEM code page (German: 0x81) ) try: time.sleep(1) @@ -67,6 +68,7 @@ def test_explicit_dry_or_no_pause_skips_wait(tmp_path, opt): capture_output=True, text=True, encoding="utf-8", + errors="replace", # cmd.exe `pause` prints in the OEM code page (German: 0x81) timeout=10, ) assert result.returncode == 23 and "[TEST]" in result.stdout and not result.stderr