mirror of
https://github.com/ProjectLeonida/mandy.git
synced 2026-12-06 17:48:40 +00:00
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:
@ -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())
|
||||
|
||||
@ -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())
|
||||
|
||||
Reference in New Issue
Block a user