upleb.uk

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

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Trencansky <jan.trencansky@protonmail.com>2026-11-26 09:23:38 -0500
committerJan Trencansky <jan.trencansky@protonmail.com>2026-11-26 09:23:38 -0500
commit071ec8449caf234f3255cdc083afd9db2eda399b (patch)
tree069c877a01da51f6eddc74f060bd6e5e060752da
parent96d8ce0802f5074173acd89cd0bb68325e5aaa7d (diff)
address guard: the two programs set errors='replace' on stdout
tests/test_tool_stdout_encoding.py requires it of every program's __main__ block. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
-rw-r--r--scripts/run_address_guard_gpu_test.py4
-rw-r--r--tools/address_guard.py4
2 files changed, 8 insertions, 0 deletions
diff --git a/scripts/run_address_guard_gpu_test.py b/scripts/run_address_guard_gpu_test.py
index ea42bdfae..f7aa53366 100644
--- a/scripts/run_address_guard_gpu_test.py
+++ b/scripts/run_address_guard_gpu_test.py
@@ -126,4 +126,8 @@ def main(argv=None):
126 126
127 127
128if __name__ == "__main__": 128if __name__ == "__main__":
129 try: # a redirected stdout is strict ANSI code page under -I; write '?' for what it cannot encode
130 sys.stdout.reconfigure(errors="replace")
131 except (AttributeError, ValueError, OSError):
132 pass
129 sys.exit(main()) 133 sys.exit(main())
diff --git a/tools/address_guard.py b/tools/address_guard.py
index 65297965e..1acbad528 100644
--- a/tools/address_guard.py
+++ b/tools/address_guard.py
@@ -103,4 +103,8 @@ def main(argv=None):
103 103
104 104
105if __name__ == "__main__": 105if __name__ == "__main__":
106 try: # a redirected stdout is strict ANSI code page under -I; write '?' for what it cannot encode
107 sys.stdout.reconfigure(errors="replace")
108 except (AttributeError, ValueError, OSError):
109 pass
106 sys.exit(main()) 110 sys.exit(main())