mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:15:51 +01:00
[PR #1425] tests: assert the PermissionError filename as OSError renders it (TEST-WIN-PERMERR-REPR) #1455
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#1455
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/1425
Author: @thiefyzheng
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:fix/test-permerr-repr📝 Commits (1)
04b6b2etests: assert the PermissionError filename as OSError renders it (TEST-WIN-PERMERR-REPR)📊 Changes
3 files changed (+3 additions, -3 deletions)
View changed files
📝
tests/test_bink_names.py(+1 -1)📝
tests/test_opus_tags.py(+1 -1)📝
tests/test_world_names.py(+1 -1)📄 Description
What
One line in each of three test files:
self.assertIn(blocked, err.getvalue())→self.assertIn(repr(blocked), err.getvalue()).Why
The finding is @GTAVIB4GTAVI's (coordination issue #14, 23:34:10Z): the three unreadable-directory tests mock
os.walk'sonerrorwithPermissionError(13, "Permission denied", blocked)and assert the path appears in the tool's stderr. The tools printERROR: {e}—tools/world_names.py:671,tools/bink_names.py:459,tools/opus_tags.py:278— andstr(OSError)renders.filenamewithrepr(): quoted, backslashes doubled. On Windows each of the three assertions failed on the actual repr'd line; on Linux the paths contain no backslashes, so the files pass there and the defect was invisible to the Linux CI. The assertion now comparesrepr(blocked)— the exact rendering under test — which passes on both platforms.This is the finding's first suggested form ("compare the value against the error's rendered filename"). Its alternative — the tools printing the path unquoted, as
tools/awc_manifest.py:268andtools/bink_index.py:438already do — would change three tools' stderr, and is a tools/ change rather than this one; happy to do that instead if a reviewer prefers the tool-side behavior.Corroboration: sibling tests with the same assertion shape pass on Windows because their tools print the path unquoted (
test_awc_manifest.py:312→tools/awc_manifest.py:268;test_bink_index.py:339), andtest_awc_opus.py:435-436asserts only the basename andstrerror, which the repr'd line contains — so exactly these three tests fail, as the finding said.What I ran
Windows 11 (Python 3.12.10), before (hub main
507029d1e): one named failure per file, at the finding's exact lines —test_world_names.py:49(1 of 31),test_bink_names.py:340(1 of 36),test_opus_tags.py:337(1 of 28); each assertion shows the plain path missing from the repr'd stderr line (quoted in the claim thread). After: all three files OK — 31/36/28 tests. Linux (CPython 3.13): before and after, all three files OK with identical counts, so the fix does not change Linux behavior. The patch was applied byte-identically on both platforms;scripts/check_no_game_data.pyclean.Not run
Not run under the repo's full CI suites (workflows will cover these files on both platforms); the tool-side alternative was deliberately not implemented.
AI-assisted: a pi coding agent operated by the repo contributor ran the Windows reproduction and both-platform verification; the finding is @GTAVIB4GTAVI's.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.