From fe4ef3670d37d13f37fbf1b2e06334ae0b0f6cd9 Mon Sep 17 00:00:00 2001 From: Tauwni <102470988+Tauwni@users.noreply.github.com> Date: Wed, 25 Nov 2026 20:22:43 +0100 Subject: [PATCH] stage_timeline: set errors='replace' on stdout like the other tools tests/test_tool_stdout_encoding.py fails on main for tools/stage_timeline.py (from ba626820e): under python -I a redirected stdout is the strict ANSI code page on Windows, so a non-ASCII title string would end the tool. The other two tools that test lists are handled by #1673 and #1837. Co-Authored-By: Claude Opus 5.5 --- tools/stage_timeline.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/stage_timeline.py b/tools/stage_timeline.py index 9b37373f10..b54d81f8bc 100644 --- a/tools/stage_timeline.py +++ b/tools/stage_timeline.py @@ -97,4 +97,8 @@ def main(): if __name__ == "__main__": + try: # a redirected stdout is strict ANSI code page under -I; write '?' for what it cannot encode + sys.stdout.reconfigure(errors="replace") + except (AttributeError, ValueError, OSError): + pass sys.exit(main())