diff options
| author | AAyberkU <97833630+AAyberkU@users.noreply.github.com> | 2026-11-22 19:55:36 +0300 |
|---|---|---|
| committer | AAyberkU <97833630+AAyberkU@users.noreply.github.com> | 2026-11-22 19:55:36 +0300 |
| commit | a1343528f7de7fa086aefd2e13942ebe83e6db0a (patch) | |
| tree | 948cb580f3aac461473b74a3885098358c925334 /scripts/run_gpu_tests.py | |
| parent | 49475796c226c8511b9470bf97a4daf57b8af323 (diff) | |
scripts, viewer: a redirected stdout no longer dies on a path outside the code page
Under `python -I` on Windows a redirected stdout is strict ANSI, so printing a path with a character outside the
code page raised UnicodeEncodeError. tools/ guards against it at the start of every __main__ block and
tests/test_tool_stdout_encoding.py enforces that, but only for tools/. viewer/serve.py died before it started
serving and scripts/audit_shader4_regs.py exited 1 after writing its report; bench_wave64.py and run_gpu_tests.py
print the same kind of output unguarded. All four get the guard, and the check now covers scripts/ and viewer/.
Co-Authored-By: Claude Mythos 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016ABh36DZ2sZNq3ChN6EZJs
Diffstat (limited to 'scripts/run_gpu_tests.py')
| -rw-r--r-- | scripts/run_gpu_tests.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/scripts/run_gpu_tests.py b/scripts/run_gpu_tests.py index 698ec36d0..5eb7b4161 100644 --- a/scripts/run_gpu_tests.py +++ b/scripts/run_gpu_tests.py | |||
| @@ -1281,4 +1281,8 @@ def run_suite(a, work: str) -> int: | |||
| 1281 | 1281 | ||
| 1282 | 1282 | ||
| 1283 | if __name__ == "__main__": | 1283 | if __name__ == "__main__": |
| 1284 | try: # a redirected stdout is strict ANSI code page under -I; write '?' for what it cannot encode | ||
| 1285 | sys.stdout.reconfigure(errors="replace") | ||
| 1286 | except (AttributeError, ValueError, OSError): | ||
| 1287 | pass | ||
| 1284 | sys.exit(main()) | 1288 | sys.exit(main()) |