tests: expect the unreadable path as OSError prints it (bink_names, opus_tags, world_names) (OLD-10046) #763

Closed
abnalstlll-byte wants to merge 1 commit from upstream-pr/763 into main
abnalstlll-byte commented 2026-11-24 13:34:24 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by abnalstlll-byte on 2026-11-24T13:34:24Z.


Carries old PR 10046 (draft #312, old-pr/10046 by @icecreammule277-dot), rebased cleanly on current main (2d73c242f).

What this does

Each test makes the tree walk report an unreadable folder and asserts the folder's path appears in the tool's error message. The message embeds str(OSError), which prints the filename with repr(), so on Windows every backslash is doubled and assertIn(path, message) misses. Expect repr(path), which is the exact text OSError produces on Windows while remaining identical on POSIX.

Verification

  • python -I tests/test_world_names.py: 31/31 PASS (resolves Windows failure)
  • python -I tests/test_bink_names.py: 36/36 PASS (resolves Windows failure)
  • python -I tests/test_opus_tags.py: 28/28 PASS (resolves Windows failure)
  • python -I scripts/check_no_game_data.py: clean
  • Standard library only, no game data. AI-assisted.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5473156005 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/763). Originally posted by [abnalstlll-byte](https://github.com/abnalstlll-byte) on 2026-11-24T13:34:24Z. --- Carries old PR 10046 (draft #312, old-pr/10046 by @icecreammule277-dot), rebased cleanly on current main (2d73c242f). ### What this does Each test makes the tree walk report an unreadable folder and asserts the folder's path appears in the tool's error message. The message embeds str(OSError), which prints the filename with repr(), so on Windows every backslash is doubled and assertIn(path, message) misses. Expect repr(path), which is the exact text OSError produces on Windows while remaining identical on POSIX. ### Verification - python -I tests/test_world_names.py: 31/31 PASS (resolves Windows failure) - python -I tests/test_bink_names.py: 36/36 PASS (resolves Windows failure) - python -I tests/test_opus_tags.py: 28/28 PASS (resolves Windows failure) - python -I scripts/check_no_game_data.py: clean - Standard library only, no game data. AI-assisted.
lixonik commented 2026-11-24 13:44:07 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-11-24T13:44:07Z.

Review: COMMENTED


Independent check from full Git worktrees at e04c4216 and 2d73c242. On Windows the base failed exactly the one unreadable-directory assertion in each of the three changed suites. The PR passed all 95 tests on Windows (36 Bink, 28 Opus, 31 world names). The same 95 also passed on Linux under local WSL, confirming the new repr assertions work on both platforms.

Commands used python -I -B on each of the three test files. AI-assisted testing with synthetic inputs. No game files or GPU used.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6040276770 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/763#pullrequestreview-6040276770). Originally posted by [lixonik](https://github.com/lixonik) on 2026-11-24T13:44:07Z. **Review:** COMMENTED --- Independent check from full Git worktrees at `e04c4216` and `2d73c242`. On Windows the base failed exactly the one unreadable-directory assertion in each of the three changed suites. The PR passed all 95 tests on Windows (36 Bink, 28 Opus, 31 world names). The same 95 also passed on Linux under local WSL, confirming the new `repr` assertions work on both platforms. Commands used `python -I -B` on each of the three test files. AI-assisted testing with synthetic inputs. No game files or GPU used.
nilparra-dev commented 2026-11-24 17:09:42 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by nilparra-dev on 2026-11-24T17:09:42Z.


Measured conflict with #128 on native Windows 11, Python 3.13, clean worktrees (no game files, no GPU):

  • Your head e04c4216: all 95 tests in the three files pass.
  • #128 head 82bdc54f: all 95 pass too.
  • #128's tools + your tests in one tree: 13 failures (bink_names 1, opus_tags 11, world_names 1).

So the two approaches cannot both merge; whichever lands second turns the Windows leg red. Linux CI does not show it because repr() keeps POSIX paths unchanged. Full measurement and line references are in the finding on #14.

Recommendation: close this and #312 in favour of #128, which fixes the tool's error message instead of baking the doubled-backslash form into the tests. If the maintainers prefer the test-side fix, #128 should be closed instead; either way one of them needs to go.

AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7138777779 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/763#issuecomment-7138777779). Originally posted by [nilparra-dev](https://github.com/nilparra-dev) on 2026-11-24T17:09:42Z. --- Measured conflict with #128 on native Windows 11, Python 3.13, clean worktrees (no game files, no GPU): - Your head `e04c4216`: all 95 tests in the three files pass. - #128 head `82bdc54f`: all 95 pass too. - #128's tools + your tests in one tree: **13 failures** (bink_names 1, opus_tags 11, world_names 1). So the two approaches cannot both merge; whichever lands second turns the Windows leg red. Linux CI does not show it because `repr()` keeps POSIX paths unchanged. Full measurement and line references are in the finding on #14. Recommendation: close this and #312 in favour of #128, which fixes the tool's error message instead of baking the doubled-backslash form into the tests. If the maintainers prefer the test-side fix, #128 should be closed instead; either way one of them needs to go. AI-assisted.
abnalstlll-byte commented 2026-11-24 18:39:01 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by abnalstlll-byte on 2026-11-24T18:39:01Z.


Closing in favour of #128.

Thank you @nilparra-dev and @levi2m for the thorough cross-PR Windows measurements (and @lixonik for checking Windows/WSL). Fixing the tool-side error formatting in #128 (error.filename / error.strerror) rather than hardcoding doubled-backslash repr() strings in the tests is indeed the cleaner solution and avoids keeping the conflict open.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7140941987 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/763#issuecomment-7140941987). Originally posted by [abnalstlll-byte](https://github.com/abnalstlll-byte) on 2026-11-24T18:39:01Z. --- Closing in favour of #128. Thank you @nilparra-dev and @levi2m for the thorough cross-PR Windows measurements (and @lixonik for checking Windows/WSL). Fixing the tool-side error formatting in #128 (`error.filename` / `error.strerror`) rather than hardcoding doubled-backslash `repr()` strings in the tests is indeed the cleaner solution and avoids keeping the conflict open.

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