[PR #69] [CLOSED] tests: match the path as the error message prints it on Windows #122

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

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/69
Author: @wavehs
Created: 11/24/2026
Status: ❌ Closed

Base: main ← Head: tests-win-error-path-repr


📝 Commits (1)

  • 54a2abd tests: match the path as the error message prints it on Windows

📊 Changes

3 files changed (+9 additions, -3 deletions)

View changed files

📝 tests/test_bink_names.py (+3 -1)
📝 tests/test_opus_tags.py (+3 -1)
📝 tests/test_world_names.py (+3 -1)

📄 Description

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

🔄 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/69 **Author:** [@wavehs](https://github.com/wavehs) **Created:** 11/24/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `tests-win-error-path-repr` --- ### 📝 Commits (1) - [`54a2abd`](https://github.com/ubiquitarianism/leonida/commit/54a2abdc5fb537e7780bbc0a325f552baed59c2d) tests: match the path as the error message prints it on Windows ### 📊 Changes **3 files changed** (+9 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `tests/test_bink_names.py` (+3 -1) 📝 `tests/test_opus_tags.py` (+3 -1) 📝 `tests/test_world_names.py` (+3 -1) </details> ### 📄 Description 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.) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:16:52 +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#122
No description provided.