stage_timeline: set errors='replace' on stdout like the other tools (TOOL-STAGE-TIMELINE-STDOUT) #2111

Closed
github-bot wants to merge 1 commit from github-bot/gh-2111 into main AGit
Owner

@⁠Tauwni on GitHub · 2026-11-25 21:07 UTC · original
Tauwni:fix/stage-timeline-stdout → main · +4 −0 · 1 files · 1 commits · closed without merging

Claimed in the coordination issue as: #1608

What and why

tests/test_tool_stdout_encoding.py fails on main for three tools whose __main__ block doesn't set errors='replace' on stdout. Under python -I, a redirected stdout is the strict ANSI code page on Windows, so one character it can't encode ends the tool. #1673 handles tools/compute_heap_layout_census.py and #1837 tools/game_run_summary.py. This PR handles the third, tools/stage_timeline.py (from ba626820e), with the same guarded sys.stdout.reconfigure(errors="replace") the other tools use.

Tested

  • python -I tests/test_tool_stdout_encoding.py: tools/stage_timeline.py is no longer listed. Only the two files #1673 and #1837 fix remain, and the test passes with all three merged.
  • python -I tools/stage_timeline.py --help and a run on a log without peek lines behave as before.
  • The standard-library loop and the pytest files: the same results as main (no new failure).

GPUs tested: n/a

AI-assisted: yes (Claude Code)

Checklist

  • Based on current main and merges cleanly.
  • One topic.
  • No game data, keys or decryption.
  • No translator rule.

🤖 Generated with Claude Code

**@⁠Tauwni** on GitHub · 2026-11-25 21:07 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2111) `Tauwni:fix/stage-timeline-stdout` → `main` · +4 −0 · 1 files · 1 commits · closed without merging Claimed in the coordination issue as: https://git.gtahub.st/github/ubiquitarianism--leonida/issues/1608 ### What and why `tests/test_tool_stdout_encoding.py` fails on `main` for three tools whose `__main__` block doesn't set `errors='replace'` on stdout. Under `python -I`, a redirected stdout is the strict ANSI code page on Windows, so one character it can't encode ends the tool. #1673 handles `tools/compute_heap_layout_census.py` and #1837 `tools/game_run_summary.py`. This PR handles the third, `tools/stage_timeline.py` (from `ba626820e`), with the same guarded `sys.stdout.reconfigure(errors="replace")` the other tools use. ### Tested - `python -I tests/test_tool_stdout_encoding.py`: `tools/stage_timeline.py` is no longer listed. Only the two files #1673 and #1837 fix remain, and the test passes with all three merged. - `python -I tools/stage_timeline.py --help` and a run on a log without peek lines behave as before. - The standard-library loop and the pytest files: the same results as `main` (no new failure). GPUs tested: n/a AI-assisted: yes (Claude Code) ### Checklist - [x] Based on current `main` and merges cleanly. - [x] One topic. - [x] No game data, keys or decryption. - [x] No translator rule. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
tests/test_tool_stdout_encoding.py fails on main for tools/stage_timeline.py
(from ba626820e): under python -I a redirected stdout is the strict ANSI code
page on Windows, so a non-ASCII title string would end the tool. The other two
tools that test lists are handled by #1673 and #1837.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:18:15 +00:00
github-bot closed this pull request 2026-11-26 11:27:41 +00:00
Author
Owner

@⁠Tauwni on GitHub · 2026-11-26 11:20 UTC · original

Closing: main already has this change. 4b10cbe91 ("game_run_summary, stage_timeline: set errors="replace" on stdout") sets it in tools/stage_timeline.py, so this branch no longer differs from main. tests/test_tool_stdout_encoding.py passes on main a73a57e13.

AI-assisted (Claude Code).

**@⁠Tauwni** on GitHub · 2026-11-26 11:20 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2111#issuecomment-7190597911) Closing: `main` already has this change. `4b10cbe91` ("game_run_summary, stage_timeline: set errors=\"replace\" on stdout") sets it in `tools/stage_timeline.py`, so this branch no longer differs from `main`. `tests/test_tool_stdout_encoding.py` passes on `main` `a73a57e13`. AI-assisted (Claude Code).

Pull request closed

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