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

Closed
leonida/mandy
abnalstlll-byte wants to merge 0 commits from restore/old-10046-tests-oserror-repr into main

Pull request closed

This pull request cannot be reopened because the branch was deleted.

abnalstlll-byte commented 2026-11-24 13:34:24 +00:00

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.
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 reviewed 2026-11-24 13:44:07 +00:00
lixonik left a comment
No description provided.
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

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.

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

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.

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.
Sign in to join this conversation.
No description provided.