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>
This commit is contained in:
Jan Trencansky
2026-11-26 09:23:38 -05:00
parent 96d8ce0802
commit 071ec8449c
2 changed files with 8 additions and 0 deletions

View File

@ -126,4 +126,8 @@ def main(argv=None):
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())

View File

@ -103,4 +103,8 @@ def main(argv=None):
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())