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

Closed
wavehs wants to merge 1 commit from upstream-pr/69 into main
wavehs commented 2026-11-24 02:12:27 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by wavehs on 2026-11-24T02:12:27Z.


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.)
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5464767488 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/69). Originally posted by [wavehs](https://github.com/wavehs) on 2026-11-24T02:12:27Z. --- 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.)
wavehs commented 2026-11-24 02:27:00 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by wavehs on 2026-11-24T02:27:00Z.


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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7120153989 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/69#issuecomment-7120153989). Originally posted by [wavehs](https://github.com/wavehs) on 2026-11-24T02:27:00Z. --- 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

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!69
No description provided.