From 1d7212e640fd23e053befdc13f7cbb8ac447a507 Mon Sep 17 00:00:00 2001 From: fiestorra Date: Tue, 1 Dec 2026 04:53:35 +0100 Subject: [PATCH] tools: make_amplify_dxil writes '?' for what a redirected stdout cannot encode test_tool_stdout_encoding.py requires every tool's __main__ to set errors='replace' on stdout, for a redirected stdout that is a strict ANSI code page under -I. The new tool did not, so main failed that test on both Linux and Windows. Same block as ab_control_flow.py and the other tools. --- tools/make_amplify_dxil.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/make_amplify_dxil.py b/tools/make_amplify_dxil.py index 8fa71cff06..0f38be9b1f 100644 --- a/tools/make_amplify_dxil.py +++ b/tools/make_amplify_dxil.py @@ -66,4 +66,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 main()