upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/scripts/bench_wave64.py
diff options
context:
space:
mode:
authorAAyberkU <97833630+AAyberkU@users.noreply.github.com>2026-11-22 19:55:36 +0300
committerAAyberkU <97833630+AAyberkU@users.noreply.github.com>2026-11-22 19:55:36 +0300
commita1343528f7de7fa086aefd2e13942ebe83e6db0a (patch)
tree948cb580f3aac461473b74a3885098358c925334 /scripts/bench_wave64.py
parent49475796c226c8511b9470bf97a4daf57b8af323 (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/bench_wave64.py')
-rw-r--r--scripts/bench_wave64.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/scripts/bench_wave64.py b/scripts/bench_wave64.py
index 14b397f97..57b0c31ef 100644
--- a/scripts/bench_wave64.py
+++ b/scripts/bench_wave64.py
@@ -116,4 +116,8 @@ def main():
116 116
117 117
118if __name__ == "__main__": 118if __name__ == "__main__":
119 try: # a redirected stdout is strict ANSI code page under -I; write '?' for what it cannot encode
120 sys.stdout.reconfigure(errors="replace")
121 except (AttributeError, ValueError, OSError):
122 pass
119 sys.exit(main()) 123 sys.exit(main())