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:
cweohme
2026-11-28 03:49:04 +03:00
parent 431ceba4f4
commit 635bab171f
8 changed files with 8 additions and 0 deletions

View File

@ -72,4 +72,5 @@ def main():
if __name__ == "__main__":
sys.stdout.reconfigure(errors="replace")
sys.exit(main())

View File

@ -316,4 +316,5 @@ def main():
if __name__ == "__main__":
sys.stdout.reconfigure(errors="replace")
sys.exit(main())

View File

@ -90,4 +90,5 @@ def main():
if __name__ == "__main__":
sys.stdout.reconfigure(errors="replace")
sys.exit(main())

View File

@ -1044,4 +1044,5 @@ def main() -> int:
if __name__ == "__main__":
sys.stdout.reconfigure(errors="replace")
raise SystemExit(main())

View File

@ -793,4 +793,5 @@ def main(argv):
if __name__ == "__main__":
sys.stdout.reconfigure(errors="replace")
main(sys.argv[1:])

View File

@ -149,4 +149,5 @@ def main(argv=None):
if __name__ == "__main__":
sys.stdout.reconfigure(errors="replace")
sys.exit(main())

View File

@ -78,4 +78,5 @@ def main(argv):
if __name__ == "__main__":
sys.stdout.reconfigure(errors="replace")
sys.exit(main(sys.argv[1:]))

View File

@ -96,4 +96,5 @@ def main(argv=None):
if __name__ == "__main__":
sys.stdout.reconfigure(errors="replace")
sys.exit(main())