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

Closed
opened 2026-11-26 21:20:07 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/2118
Author: @kevincommits
Created: 11/25/2026
Status: ❌ Closed

Base: main ← Head: tool-corpus-watch-stdout


📝 Commits (1)

  • 5f8b70f fix: corpus_watch sets errors='replace' on stdout like the other tools

📊 Changes

1 file changed (+4 additions, -0 deletions)

View changed files

📝 scripts/corpus_watch.py (+4 -0)

📄 Description

Claimed in the coordination issue as: TOOL-CORPUS-WATCH-STDOUT (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7175070245)

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)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/2118 **Author:** [@kevincommits](https://github.com/kevincommits) **Created:** 11/25/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `tool-corpus-watch-stdout` --- ### 📝 Commits (1) - [`5f8b70f`](https://github.com/ubiquitarianism/leonida/commit/5f8b70fcc3a2086ee5248281853468b5632cb5c4) fix: corpus_watch sets errors='replace' on stdout like the other tools ### 📊 Changes **1 file changed** (+4 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `scripts/corpus_watch.py` (+4 -0) </details> ### 📄 Description Claimed in the coordination issue as: TOOL-CORPUS-WATCH-STDOUT (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7175070245) ### 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) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 21:20:07 +01:00
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#2122
No description provided.