[PR #312] [CLOSED] tests: expect the unreadable path as OSError prints it (bink_names, opus_tags, world_names) #364

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

📋 Pull Request Information

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

Base: main ← Head: old-pr/10046


📝 Commits (1)

  • e29f8f0 tests: expect the unreadable path as OSError prints it (bink_names, opus_tags, world_names)

📊 Changes

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

View changed files

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

📄 Description

Carried over from old PR 10046 by icecreammule277-dot in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch old-pr/10046, exactly that PR's last commit. All carried-over PRs are listed in #17.
Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it.
icecreammule277-dot: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one.


Original description (mentions and #N references are disabled; the numbers refer to the old repository):

Claimed in the coordination issue as: https://github.com/ProjectLeonida/Leonida/issues/9677#issuecomment-7117092144 (test fix, no ID assigned)

Depends on: none.

What and why

tests/test_bink_names.py, tests/test_opus_tags.py and tests/test_world_names.py each make the tree walk report an unreadable folder (onerror(PermissionError(13, ..., blocked))) and assert that the folder's path appears in the tool's error message. That message embeds str(OSError), and OSError.__str__ prints the filename with repr(). On Windows a path has backslashes, so the message holds 'C:\\Users\\...' and assertIn(blocked, message) misses it. All three fail on main with the same shape, e.g. "'C:\Users\...\blocked' not found in "opus_tags: error: [Errno 13] Permission denied: 'C:\\Users\\...\\blocked'"".

Each assertion now expects repr(blocked), which is exactly the text OSError produces. On POSIX paths hold no backslashes or quotes, so repr(blocked) is just the quoted path and the check is as strict as before. Test only; no tool change.

Tested

Windows 11 (10.0.26300), CPython 3.15.2, no GPU or game files, on main de4c37383:

test main this branch
tests/test_bink_names.py FAIL (1) OK
tests/test_opus_tags.py FAIL (1) OK
tests/test_world_names.py FAIL (1) OK

I did not run a POSIX interpreter; the POSIX equivalence above is by reading OSError.__str__, not by a run.

AI-assisted: yes (Claude Code, Claude Sonnet 5.5).

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. (n/a: 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/312 **Author:** [@Andretuta](https://github.com/Andretuta) **Created:** 11/24/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `old-pr/10046` --- ### 📝 Commits (1) - [`e29f8f0`](https://github.com/ubiquitarianism/leonida/commit/e29f8f0971e53c2fee57bd57d6809360e4971f2e) tests: expect the unreadable path as OSError prints it (bink_names, opus_tags, world_names) ### 📊 Changes **3 files changed** (+6 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `tests/test_bink_names.py` (+2 -1) 📝 `tests/test_opus_tags.py` (+2 -1) 📝 `tests/test_world_names.py` (+2 -1) </details> ### 📄 Description > Carried over from **old PR 10046** by `icecreammule277-dot` in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch `old-pr/10046`, exactly that PR's last commit. All carried-over PRs are listed in #17. > Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it. > `icecreammule277-dot`: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one. --- Original description (mentions and `#N` references are disabled; the numbers refer to the old repository): Claimed in the coordination issue as: https://github.com/ProjectLeonida/Leonida/issues/9677#issuecomment-7117092144 (test fix, no ID assigned) Depends on: none. ### What and why `tests/test_bink_names.py`, `tests/test_opus_tags.py` and `tests/test_world_names.py` each make the tree walk report an unreadable folder (`onerror(PermissionError(13, ..., blocked))`) and assert that the folder's path appears in the tool's error message. That message embeds `str(OSError)`, and `OSError.__str__` prints the filename with `repr()`. On Windows a path has backslashes, so the message holds `'C:\\Users\\...'` and `assertIn(blocked, message)` misses it. All three fail on `main` with the same shape, e.g. "`'C:\Users\...\blocked' not found in "opus_tags: error: [Errno 13] Permission denied: 'C:\\Users\\...\\blocked'"`". Each assertion now expects `repr(blocked)`, which is exactly the text `OSError` produces. On POSIX paths hold no backslashes or quotes, so `repr(blocked)` is just the quoted path and the check is as strict as before. Test only; no tool change. ### Tested Windows 11 (10.0.26300), CPython 3.15.2, no GPU or game files, on `main` de4c37383: | test | `main` | this branch | |---|---|---| | `tests/test_bink_names.py` | FAIL (1) | OK | | `tests/test_opus_tags.py` | FAIL (1) | OK | | `tests/test_world_names.py` | FAIL (1) | OK | I did not run a POSIX interpreter; the POSIX equivalence above is by reading `OSError.__str__`, not by a run. AI-assisted: yes (Claude Code, Claude Sonnet 5.5). ### Checklist - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [x] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (n/a: 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:17:38 +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#364
No description provided.