tests: match the path as the error message prints it on Windows #69

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

@⁠wavehs on GitHub · 2026-11-24 02:12 UTC · original
wavehs:tests-win-error-path-repr → main · +9 −3 · 3 files · 1 commits · closed without merging

Claimed in the coordination issue as: none — the original project's coordination issue was lost with its repository, and this repository's issue index (#18) has no entry for these. No open pull request touches these three files.

Depends on: none.

What and why

The Windows check job collects every failing file, and three of them fail for one reason: OSError.__str__ prints the filename with %r, so on Windows each backslash in the message is doubled.

FAIL: test_unreadable_mount_directory_preserves_the_report (tests/test_bink_names.py:340)
AssertionError: 'C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\tmpdb9s4_zi\\mount\\blocked' not found in
              "bink_names: error: [Errno 13] permission denied: 'C:\\\\Users\\\\RUNNER~1\\\\AppData\\\\Local\\\\Temp\\\\tmpdb9s4_zi\\\\mount\\\\blocked'\n"

The same assertion in tests/test_world_names.py:49 and tests/test_opus_tags.py:337 fails the same way. On POSIX there is nothing to escape, which is why these only fail on Windows. The tests now compare repr(blocked), which is exactly what the tool prints — the product's message is Python's own and is right.

Tested

macOS 15 arm64 (Apple M3 Pro), CPython 3.15.2; no game files.

  • All three files: OK here, before and after (the escaping only happens on Windows).
  • The failing shape is reproduced by building the same PermissionError from a Windows path:
    blocked in message → False, repr(blocked) in message → True.
  • The Windows failure itself is the check job log quoted above (9ec34cdff, run 45306800350, job 138157329747) — I have no Windows host to re-run it on.

compileall clean, check_no_game_data.py clean. Not run: Windows, any GPU test.

AI-assisted: yes.

Checklist

  • 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. (Not applicable: test-only.)
**@⁠wavehs** on GitHub · 2026-11-24 02:12 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/69) `wavehs:tests-win-error-path-repr` → `main` · +9 −3 · 3 files · 1 commits · closed without merging Claimed in the coordination issue as: none — the original project's coordination issue was lost with its repository, and this repository's issue index (#18) has no entry for these. No open pull request touches these three files. Depends on: none. ### What and why The Windows `check` job collects every failing file, and three of them fail for one reason: `OSError.__str__` prints the filename with `%r`, so on Windows each backslash in the message is doubled. ``` FAIL: test_unreadable_mount_directory_preserves_the_report (tests/test_bink_names.py:340) AssertionError: 'C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\tmpdb9s4_zi\\mount\\blocked' not found in "bink_names: error: [Errno 13] permission denied: 'C:\\\\Users\\\\RUNNER~1\\\\AppData\\\\Local\\\\Temp\\\\tmpdb9s4_zi\\\\mount\\\\blocked'\n" ``` The same assertion in `tests/test_world_names.py:49` and `tests/test_opus_tags.py:337` fails the same way. On POSIX there is nothing to escape, which is why these only fail on Windows. The tests now compare `repr(blocked)`, which is exactly what the tool prints — the product's message is Python's own and is right. ### Tested macOS 15 arm64 (Apple M3 Pro), CPython 3.15.2; no game files. - All three files: `OK` here, before and after (the escaping only happens on Windows). - The failing shape is reproduced by building the same `PermissionError` from a Windows path: `blocked in message` → `False`, `repr(blocked) in message` → `True`. - The Windows failure itself is the `check` job log quoted above (`9ec34cdff`, run 45306800350, job 138157329747) — I have no Windows host to re-run it on. `compileall` clean, `check_no_game_data.py` clean. Not run: Windows, any GPU test. AI-assisted: yes. ### Checklist - [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. (Not applicable: test-only.)
OSError.__str__ formats the filename with %r, so on Windows every backslash
is doubled: the message holds C:\\Users\\... where the tempfile path is
C:\Users\.... three tests asserted the raw path with assertIn and failed on
Windows only ('not found in "ERROR: [Errno 13] Permission denied:
C:\\\\Users..."'), which is how the check job keeps three files red.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 08:43:01 +00:00
github-bot closed this pull request 2026-11-26 08:43:01 +00:00
Author
Owner

@⁠wavehs on GitHub · 2026-11-24 02:27 UTC · original

Closing in favour of a decision between the two preserved approaches to the same three failing assertions:

  • #128 (old PR 9861, milas6669) prints the plain path instead of an OSError repr in the tools' messages;
  • old PR 10046 (icecreammule277-dot, not yet re-landed) makes the tests expect the repr, which is what this pull request did.

They conflict: if #128 lands, the messages lose the doubled backslashes and the tests have to keep asserting the raw path, so merging both would leave one side wrong. Whoever merges #128 should just drop this; if 10046 is preferred instead, this is the same change.

**@⁠wavehs** on GitHub · 2026-11-24 02:27 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/69#issuecomment-7120153989) Closing in favour of a decision between the two preserved approaches to the same three failing assertions: - #128 (old PR 9861, milas6669) prints the plain path instead of an `OSError` repr in the tools' messages; - old PR 10046 (icecreammule277-dot, not yet re-landed) makes the tests expect the repr, which is what this pull request did. They conflict: if #128 lands, the messages lose the doubled backslashes and the tests have to keep asserting the raw path, so merging both would leave one side wrong. Whoever merges #128 should just drop this; if 10046 is preferred instead, this is the same change.

Pull request closed

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