From 212f3162bb5b8110d1f1310c5bc3013b2136de00 Mon Sep 17 00:00:00 2001 From: Vito Sansevero Date: Mon, 26 Oct 2026 06:19:48 -0700 Subject: [PATCH] test: decode the runner's stderr as UTF-8 on Windows too (#350) A child Python writes a piped stderr in the ANSI codepage on Windows, so the non-ASCII limit value in the usage-error test came back as U+FFFD. The helper now sets PYTHONIOENCODING=utf-8 for the child. --- tests/test_run_suite.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/test_run_suite.py b/tests/test_run_suite.py index 3ae20442..7ce5077c 100644 --- a/tests/test_run_suite.py +++ b/tests/test_run_suite.py @@ -23,6 +23,9 @@ WATCHDOG_ENV = ("PM_TEST_HANG_LIMIT", "PM_TEST_SHUTDOWN_LIMIT") def run_suite(folder, extra_env=None, *args, verbosity=("-v",)): """Run the runner on ``folder`` and return the completed process.""" env = {k: v for k, v in os.environ.items() if k not in WATCHDOG_ENV} + # Windows writes a piped stderr in the ANSI codepage; ask for the UTF-8 + # this helper decodes, so non-ASCII values and paths survive. + env["PYTHONIOENCODING"] = "utf-8" env.update(extra_env or {}) command = [sys.executable, "-m", "tests.run_suite", "-s", str(folder)] return subprocess.run(