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

Closed
github-bot wants to merge 1 commit from gh-pr/2118/head into gh-pr/2118/base
Owner

@⁠kevincommits on GitHub · 2026-11-25 21:26 UTC · original
kevincommits:tool-corpus-watch-stdout → main · +4 −0 · 1 files · 1 commits · closed without merging

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

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** on GitHub · 2026-11-25 21:26 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2118) `kevincommits:tool-corpus-watch-stdout` → `main` · +4 −0 · 1 files · 1 commits · closed without merging Claimed in the coordination issue as: TOOL-CORPUS-WATCH-STDOUT (https://git.gtahub.st/github/ubiquitarianism--leonida/issues/1608) ### 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 - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] 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)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:18:28 +00:00
github-bot closed this pull request 2026-11-26 10:18:28 +00:00
Author
Owner

@⁠JordanWebDev on GitHub · 2026-11-25 23:41 UTC · original · approved these changes

**@⁠JordanWebDev** on GitHub · 2026-11-25 23:41 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2118#pullrequestreview-6066541054) · **approved these changes**
Author
Owner

@⁠kevincommits on GitHub · 2026-11-26 01:02 UTC · original

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.

**@⁠kevincommits** on GitHub · 2026-11-26 01:02 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2118#issuecomment-7179374355) 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.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.