Skip to content

corpus_watch: set errors='replace' on stdout like the other tools (TOOL-CORPUS-WATCH-STDOUT) - #2118

Closed
kevincommits wants to merge 1 commit into
ProjectLeonida:mainfrom
kevincommits:tool-corpus-watch-stdout
Closed

kevincommits wants to merge 1 commit into
ProjectLeonida:mainfrom
kevincommits:tool-corpus-watch-stdout

Conversation

@kevincommits

Copy link
Copy Markdown

Claimed in the coordination issue as: TOOL-CORPUS-WATCH-STDOUT (#1608 (comment))

What and why

scripts/corpus_watch.py (added in 5ba7f354) runs sys.exit(main()) without the errors="replace" stdout guard the other programs carry, so tests/test_tool_stdout_encoding.py lists it. This adds the same four-line guard tools/feature_scan.py uses to its __main__ block. Nothing else changes.

The same test also lists tools/compute_heap_layout_census.py, tools/game_run_summary.py and tools/stage_timeline.py on main. Those are covered by #1561, #1673, #1789, #1837, #1866 and #2111, so this pull request leaves them alone and the test stays red until one of those merges.

Tested

On macOS (Apple M5 Pro), Python 3.14.2, at 7b523287:

  • python -I tests/test_tool_stdout_encoding.py: the missing list goes from four entries to three; scripts/corpus_watch.py is no longer in it.
  • python -I tests/test_corpus_watch.py: OK.
  • python -I scripts/corpus_watch.py --help: prints usage.
  • Every standalone tests/test_*.py under python -I: 509 run, 505 pass. The 4 that fail are the same 4 that fail on main without this change (test_mod_pack_output_alias on macOS, test_runner_calls_all_tests, test_runtime_paths, test_tool_stdout_encoding), each with an open pull request.

Not tested on Windows, where the guard matters.

GPUs tested: n/a

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a: no translator change)

@kevincommits
kevincommits marked this pull request as ready for review November 25, 2026 21:32
@kevincommits

Copy link
Copy Markdown
Author

Closing as superseded: d9bb37465 in #1561 ("guard the scripts that landed since") added the same guard to scripts/corpus_watch.py, and that merged as f1afede5e. The file on main is now identical to this branch, and python -I tests/test_tool_stdout_encoding.py passes on main here. Nothing left for this pull request to change. Thanks for the review, @JordanWebDev.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants