native_pso_hashes: stdout gets the errors=replace guard (NATIVE-PSO-HASHES-HELP) #883

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

@⁠Luna-OS on GitHub · 2026-11-24 14:55 UTC · original
Luna-OS:fix/native-pso-hashes-help → main · +4 −0 · 1 files · 1 commits · closed without merging

Claimed in the coordination issue as: NATIVE-PSO-HASHES-HELP (#14)

What and why

tests/test_tool_stdout_encoding.py requires every tool's __main__ block to set errors="replace" on stdout, and it fails on main because tools/native_pso_hashes.py has no guard:

- ['tools/native_pso_hashes.py']
+ [] : programs whose __main__ block doesn't set errors='replace' on stdout

This adds the same guard the other tools use. (The --help half of the original claim landed separately in 116de82, so this PR was rebased down to the guard.)

Tested

Windows 11, Python 3.13.7, no game files: tests/test_tool_stdout_encoding.py OK (was 1 failure), tests/test_native_pso_hashes.py OK.

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 changed.

🤖 Generated with Claude Code

**@⁠Luna-OS** on GitHub · 2026-11-24 14:55 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/883) `Luna-OS:fix/native-pso-hashes-help` → `main` · +4 −0 · 1 files · 1 commits · closed without merging Claimed in the coordination issue as: NATIVE-PSO-HASHES-HELP (https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14) ### What and why `tests/test_tool_stdout_encoding.py` requires every tool's `__main__` block to set `errors="replace"` on stdout, and it fails on `main` because `tools/native_pso_hashes.py` has no guard: ``` - ['tools/native_pso_hashes.py'] + [] : programs whose __main__ block doesn't set errors='replace' on stdout ``` This adds the same guard the other tools use. (The `--help` half of the original claim landed separately in 116de82, so this PR was rebased down to the guard.) ### Tested Windows 11, Python 3.13.7, no game files: `tests/test_tool_stdout_encoding.py` OK (was 1 failure), `tests/test_native_pso_hashes.py` OK. 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 changed. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The --help half landed in 116de82; tests/test_tool_stdout_encoding.py still
listed this tool as missing the __main__ stdout guard.

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

@⁠LewisStephens99 on GitHub · 2026-11-24 15:06 UTC · original

Independent verification on Windows 11, Python 3.14:n- python -I tests/test_tool_startup.py: 2/2 passed.n- python -I tests/test_native_pso_hashes.py: 9/9 passed.n- python -I tools/native_pso_hashes.py --help: exits 0 and prints usage.n`nNo game files or GPU used. AI-assisted.

**@⁠LewisStephens99** on GitHub · 2026-11-24 15:06 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/883#issuecomment-7135481896) Independent verification on Windows 11, Python 3.14:`n- `python -I tests/test_tool_startup.py`: 2/2 passed.`n- `python -I tests/test_native_pso_hashes.py`: 9/9 passed.`n- `python -I tools/native_pso_hashes.py --help`: exits 0 and prints usage.`n`nNo game files or GPU used. AI-assisted.
Author
Owner

@⁠Luna-OS on GitHub · 2026-11-24 15:24 UTC · original

Rebased on main: the --help half (and its test) landed separately in 116de82, so this PR now only adds the __main__ stdout guard that tests/test_tool_stdout_encoding.py still reports as missing. Re-checked: test_tool_stdout_encoding.py and test_native_pso_hashes.py both OK on Windows 11 / Python 3.13.7.

**@⁠Luna-OS** on GitHub · 2026-11-24 15:24 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/883#issuecomment-7135962903) Rebased on main: the `--help` half (and its test) landed separately in 116de82, so this PR now only adds the `__main__` stdout guard that `tests/test_tool_stdout_encoding.py` still reports as missing. Re-checked: `test_tool_stdout_encoding.py` and `test_native_pso_hashes.py` both OK on Windows 11 / Python 3.13.7.
Author
Owner

@⁠MoonEyes on GitHub · 2026-11-24 16:12 UTC · original · approved these changes

LGTM. Measured on Windows 11, Python 3.14, against current main 0af7753c0:

  • main: python -I tests/test_tool_stdout_encoding.py fails with ['tools/native_pso_hashes.py'] != []. On CI, this is the only real failure in the stdlib-tests-linux and macos-python jobs of main (run 45369028646; on that older commit, the list was exe_sha / pr_conflict_label, fixed since by #605).
  • main + this PR (merged locally, no conflict): test_tool_stdout_encoding.py OK, test_native_pso_hashes.py OK, and tools/native_pso_hashes.py --help exits 0.

The guard is the same try: sys.stdout.reconfigure(errors="replace") block the other tools use, and only __main__ changes.

AI-assisted: yes (Claude Code ran the measurements; I checked them).

**@⁠MoonEyes** on GitHub · 2026-11-24 16:12 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/883#pullrequestreview-6042985816) · **approved these changes** LGTM. Measured on Windows 11, Python 3.14, against current `main` 0af7753c0: - main: `python -I tests/test_tool_stdout_encoding.py` fails with `['tools/native_pso_hashes.py'] != []`. On CI, this is the only real failure in the `stdlib-tests-linux` and `macos-python` jobs of main (run 45369028646; on that older commit, the list was `exe_sha` / `pr_conflict_label`, fixed since by #605). - main + this PR (merged locally, no conflict): `test_tool_stdout_encoding.py` OK, `test_native_pso_hashes.py` OK, and `tools/native_pso_hashes.py --help` exits 0. The guard is the same `try: sys.stdout.reconfigure(errors="replace")` block the other tools use, and only `__main__` changes. AI-assisted: yes (Claude Code ran the measurements; I checked them).
Author
Owner

@⁠aslan2142 on GitHub · 2026-11-24 16:50 UTC · original

Thanks for the fix. I'm closing this in favour of #948, which claimed the same change first:

  • reece-barker claimed the stdout guard for tools/native_pso_hashes.py in #14 at 13:51 UTC, an hour before NATIVE-PSO-HASHES-HELP was claimed at 14:54 UTC: #14
  • The --help half of NATIVE-PSO-HASHES-HELP was already covered by #776, merged at 14:37 UTC.
  • This PR contains only the stdout guard, and #948 has the same four lines.

If I missed an earlier claim of yours, say so here and I'll reopen it.

AI-assisted (Claude Code, Claude Opus 5.5).

**@⁠aslan2142** on GitHub · 2026-11-24 16:50 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/883#issuecomment-7138286254) Thanks for the fix. I'm closing this in favour of #948, which claimed the same change first: - reece-barker claimed the stdout guard for `tools/native_pso_hashes.py` in #14 at 13:51 UTC, an hour before `NATIVE-PSO-HASHES-HELP` was claimed at 14:54 UTC: https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14 - The `--help` half of `NATIVE-PSO-HASHES-HELP` was already covered by #776, merged at 14:37 UTC. - This PR contains only the stdout guard, and #948 has the same four lines. If I missed an earlier claim of yours, say so here and I'll reopen it. AI-assisted (Claude Code, Claude Opus 5.5).

Pull request closed

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