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

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

📋 Pull Request Information

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

Base: main ← Head: fix/stage-timeline-stdout


📝 Commits (1)

  • fe4ef36 stage_timeline: set errors='replace' on stdout like the other tools

📊 Changes

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

View changed files

📝 tools/stage_timeline.py (+4 -0)

📄 Description

Claimed in the coordination issue as: https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7173443163

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


🔄 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/2111 **Author:** [@Tauwni](https://github.com/Tauwni) **Created:** 11/25/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/stage-timeline-stdout` --- ### 📝 Commits (1) - [`fe4ef36`](https://github.com/ubiquitarianism/leonida/commit/fe4ef3670d37d13f37fbf1b2e06334ae0b0f6cd9) stage_timeline: set errors='replace' on stdout like the other tools ### 📊 Changes **1 file changed** (+4 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `tools/stage_timeline.py` (+4 -0) </details> ### 📄 Description Claimed in the coordination issue as: https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7173443163 ### 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) --- <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:06 +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#2117
No description provided.