diff options
| author | ItsNotRexed <300290919+ItsNotRexed@users.noreply.github.com> | 2026-11-22 23:25:51 -0500 |
|---|---|---|
| committer | ItsNotRexed <300290919+ItsNotRexed@users.noreply.github.com> | 2026-11-22 23:25:51 -0500 |
| commit | 7dbaa0409ab5e4830076014d75f2e0f6ef4f36d2 (patch) | |
| tree | fbf9dfdef96de4fa5bf48af75ef499cce5cd63db /scripts | |
| parent | 2e52b2f1d77ca37e5a4cb9136a488ae2537bba5d (diff) | |
Repo rules after round 44: stdout guards on 13 programs, newline= on four text writes
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/check_apt_key.py | 4 | ||||
| -rw-r--r-- | scripts/ci_expected_failures.py | 4 | ||||
| -rw-r--r-- | scripts/run_guest_scene.py | 4 |
3 files changed, 12 insertions, 0 deletions
diff --git a/scripts/check_apt_key.py b/scripts/check_apt_key.py index 4a773d4d7..160f0203a 100644 --- a/scripts/check_apt_key.py +++ b/scripts/check_apt_key.py | |||
| @@ -86,4 +86,8 @@ def main(argv): | |||
| 86 | 86 | ||
| 87 | 87 | ||
| 88 | if __name__ == "__main__": | 88 | if __name__ == "__main__": |
| 89 | try: # a redirected stdout is strict ANSI code page under -I; write '?' for what it cannot encode | ||
| 90 | sys.stdout.reconfigure(errors="replace") | ||
| 91 | except (AttributeError, ValueError, OSError): | ||
| 92 | pass | ||
| 89 | sys.exit(main(sys.argv[1:])) | 93 | sys.exit(main(sys.argv[1:])) |
diff --git a/scripts/ci_expected_failures.py b/scripts/ci_expected_failures.py index 13dce177d..b07b8de3c 100644 --- a/scripts/ci_expected_failures.py +++ b/scripts/ci_expected_failures.py | |||
| @@ -38,4 +38,8 @@ def main(argv: list[str]) -> int: | |||
| 38 | 38 | ||
| 39 | 39 | ||
| 40 | if __name__ == "__main__": | 40 | if __name__ == "__main__": |
| 41 | try: # a redirected stdout is strict ANSI code page under -I; write '?' for what it cannot encode | ||
| 42 | sys.stdout.reconfigure(errors="replace") | ||
| 43 | except (AttributeError, ValueError, OSError): | ||
| 44 | pass | ||
| 41 | sys.exit(main(sys.argv[1:])) | 45 | sys.exit(main(sys.argv[1:])) |
diff --git a/scripts/run_guest_scene.py b/scripts/run_guest_scene.py index b046eac71..74594c6c7 100644 --- a/scripts/run_guest_scene.py +++ b/scripts/run_guest_scene.py | |||
| @@ -340,6 +340,10 @@ def main() -> int: | |||
| 340 | 340 | ||
| 341 | 341 | ||
| 342 | if __name__ == "__main__": | 342 | if __name__ == "__main__": |
| 343 | try: # a redirected stdout is strict ANSI code page under -I; write '?' for what it cannot encode | ||
| 344 | sys.stdout.reconfigure(errors="replace") | ||
| 345 | except (AttributeError, ValueError, OSError): | ||
| 346 | pass | ||
| 343 | # Redirected Windows streams may use a code page that cannot encode a path in the report. | 347 | # Redirected Windows streams may use a code page that cannot encode a path in the report. |
| 344 | sys.stdout.reconfigure(errors="backslashreplace") | 348 | sys.stdout.reconfigure(errors="backslashreplace") |
| 345 | sys.stderr.reconfigure(errors="backslashreplace") | 349 | sys.stderr.reconfigure(errors="backslashreplace") |