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

Closed
github-bot wants to merge 1 commit from gh-pr/763/head into gh-pr/763/base
Owner

@⁠abnalstlll-byte on GitHub · 2026-11-24 13:34 UTC · original
abnalstlll-byte:restore/old-10046-tests-oserror-repr → main · +6 −3 · 3 files · 1 commits · closed without merging

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.
**@⁠abnalstlll-byte** on GitHub · 2026-11-24 13:34 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/763) `abnalstlll-byte:restore/old-10046-tests-oserror-repr` → `main` · +6 −3 · 3 files · 1 commits · closed without merging 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.
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 text OSError produces; on POSIX the two are identical.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:20:10 +00:00
github-bot closed this pull request 2026-11-26 09:20:10 +00:00
Author
Owner

@⁠lixonik on GitHub · 2026-11-24 13:44 UTC · original · reviewed

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.

**@⁠lixonik** on GitHub · 2026-11-24 13:44 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/763#pullrequestreview-6040276770) · **reviewed** 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.
Author
Owner

@⁠nilparra-dev on GitHub · 2026-11-24 17:09 UTC · original

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.

**@⁠nilparra-dev** on GitHub · 2026-11-24 17:09 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/763#issuecomment-7138777779) 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.
Author
Owner

@⁠abnalstlll-byte on GitHub · 2026-11-24 18:39 UTC · original

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.

**@⁠abnalstlll-byte** on GitHub · 2026-11-24 18:39 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/763#issuecomment-7140941987) 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

This discussion has been locked. Commenting is limited to contributors.
No description provided.