native_pso_hashes: guard stdout like every other tool #948

Merged
barkodr merged 1 commit from upstream-pr/948 into main 2026-11-24 17:05:28 +00:00
barkodr commented 2026-11-24 15:37:02 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by barkodr on 2026-11-24T15:37:02Z.


Claimed in the coordination issue as: claiming: tools/native_pso_hashes.py has no stdout errors="replace" guard (added in 62a9588), so test_tool_stdout_encoding fails on main. Tools only. AI-assisted.

What and why

tools/native_pso_hashes.py was the only tool whose __main__ block did not set errors="replace" on stdout, so tests/test_tool_stdout_encoding.py failed on main. It now starts its __main__ block with the same guard as the other tools. Bram's 116de82f6 already fixed --help, so this pull request is only the stdout guard.

Tested

On macOS 26.6.2 with Python 3.12.16 and on Ubuntu 26.04 (WSL2) with Python 3.14.4, from the checkout root with python -I: tests/test_native_pso_hashes.py, tests/test_tool_stdout_encoding.py, tests/test_tool_startup.py, tests/test_text_write_line_endings.py and tests/test_docs_python_deps.py all pass on both. test_tool_stdout_encoding.py fails on main with only tools/native_pso_hashes.py listed and passes on this branch.

GPUs tested: none (no GPU code changed)

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.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5475313775 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/948). Originally posted by [barkodr](https://github.com/barkodr) on 2026-11-24T15:37:02Z. --- Claimed in the coordination issue as: claiming: tools/native_pso_hashes.py has no stdout errors="replace" guard (added in 62a9588), so test_tool_stdout_encoding fails on main. Tools only. AI-assisted. ### What and why `tools/native_pso_hashes.py` was the only tool whose `__main__` block did not set `errors="replace"` on stdout, so `tests/test_tool_stdout_encoding.py` failed on `main`. It now starts its `__main__` block with the same guard as the other tools. Bram's 116de82f6 already fixed `--help`, so this pull request is only the stdout guard. ### Tested On macOS 26.6.2 with Python 3.12.16 and on Ubuntu 26.04 (WSL2) with Python 3.14.4, from the checkout root with `python -I`: `tests/test_native_pso_hashes.py`, `tests/test_tool_stdout_encoding.py`, `tests/test_tool_startup.py`, `tests/test_text_write_line_endings.py` and `tests/test_docs_python_deps.py` all pass on both. `test_tool_stdout_encoding.py` fails on `main` with only `tools/native_pso_hashes.py` listed and passes on this branch. GPUs tested: none (no GPU code changed) 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.
Poussistar commented 2026-11-24 15:58:55 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Poussistar on 2026-11-24T15:58:55Z.


Independent check on Linux (4 vCPU, CPython 3.14.7): the diff applied to a clean worktree at main a28927849.

  • without the diff, python -I tests/test_tool_stdout_encoding.py → First extra element 0: 'tools/native_pso_hashes.py', Ran 4 tests … FAILED (failures=1)
  • with the diff, the same command → Ran 4 tests in 0.341s … OK

tools/native_pso_hashes.py is the only program that guard still lists, so this pull request turns that repository-wide red green. tests/test_native_pso_hashes.py and tests/test_text_write_line_endings.py also pass at this head. No game files, no GPU needed.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7136929738 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/948#issuecomment-7136929738). Originally posted by [Poussistar](https://github.com/Poussistar) on 2026-11-24T15:58:55Z. --- Independent check on Linux (4 vCPU, CPython 3.14.7): the diff applied to a clean worktree at `main` `a28927849`. - without the diff, `python -I tests/test_tool_stdout_encoding.py` → `First extra element 0: 'tools/native_pso_hashes.py'`, `Ran 4 tests … FAILED (failures=1)` - with the diff, the same command → `Ran 4 tests in 0.341s … OK` `tools/native_pso_hashes.py` is the only program that guard still lists, so this pull request turns that repository-wide red green. `tests/test_native_pso_hashes.py` and `tests/test_text_write_line_endings.py` also pass at this head. No game files, no GPU needed.
Sign in to join this conversation.
No reviewers
No labels
No milestone
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.

Reference
ProjectLeonida/mandy!948
No description provided.