mirror of
https://github.com/ProjectLeonida/mandy.git
synced 2026-12-06 09:08:38 +00:00
tools/scripts: the eight remaining __main__ blocks set errors=replace on stdout
test_tool_stdout_encoding fails on main: leonida_launcher, ps_prompt_glyphs, victory_saves, volume_stats, world_hotspots, fetch_vkd3d_proton, port_ctl and sync_victory still print paths a Windows ANSI code page cannot encode, and die with UnicodeEncodeError when stdout is redirected under python -I. Add the same one-line guard the other programs already have (exe_sha.py, #605). Tested: test_tool_stdout_encoding (4 tests), test_tool_startup, test_victory_saves, compileall, run_semantic_tests (6397 tests, 0 failed). AI-assisted: yes (Qwen Code).
This commit is contained in:
@ -72,4 +72,5 @@ def main():
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.stdout.reconfigure(errors="replace")
|
||||
sys.exit(main())
|
||||
|
||||
@ -316,4 +316,5 @@ def main():
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.stdout.reconfigure(errors="replace")
|
||||
sys.exit(main())
|
||||
|
||||
@ -90,4 +90,5 @@ def main():
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.stdout.reconfigure(errors="replace")
|
||||
sys.exit(main())
|
||||
|
||||
@ -1044,4 +1044,5 @@ def main() -> int:
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.stdout.reconfigure(errors="replace")
|
||||
raise SystemExit(main())
|
||||
|
||||
@ -793,4 +793,5 @@ def main(argv):
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.stdout.reconfigure(errors="replace")
|
||||
main(sys.argv[1:])
|
||||
|
||||
@ -149,4 +149,5 @@ def main(argv=None):
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.stdout.reconfigure(errors="replace")
|
||||
sys.exit(main())
|
||||
|
||||
@ -78,4 +78,5 @@ def main(argv):
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.stdout.reconfigure(errors="replace")
|
||||
sys.exit(main(sys.argv[1:]))
|
||||
|
||||
@ -96,4 +96,5 @@ def main(argv=None):
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.stdout.reconfigure(errors="replace")
|
||||
sys.exit(main())
|
||||
|
||||
Reference in New Issue
Block a user