Repository navigation
Conversation
|
Tested
|
|
Verified on your head at main 561b65a: compileall clean; test_bcpack_tool 18/18 (re-run), test_bink_names 33, test_opus_tags 20 and test_world_names 29 all pass with the new message format, and grep confirms no existing test asserts the old repr'd form. One nit: the bcpack_tool.py hunk rewords a ValueError, not an OSError, so the title slightly overreaches — harmless. The branch reports no CI checks — worth a push. AI-assisted: yes. Tested on Linux (RTX 5080 host, CPU-only run). |
|
Tested 06d9cd0 merged with main 561b65a on Ubuntu (WSL2) / Python 3.12.16: pass tests/test_bcpack_tool.py 18/18, test_bink_names.py 33/33, test_opus_tags.py 20/20, test_world_names.py 29/29, 0 failures. The PR adds no tests; I grepped those four test files and found none asserting the old "[Errno" / repr form. Behaviour check on an unhandled OSError (unreadable mount file, bink_names): main prints |
|
One more reason to land this soon: it also fixes a test that is red on |
|
Duplicate check with #5927, measured on this machine (Windows 11 build 26300, Python 3.13, both heads against
That is six red tests on this machine, not five: The two patches are the same change in the same four files. The only difference is the case where Keep #5760 and close #5927. #5760 came first (12:01 vs 12:35) and has three independent confirmations on its One caveat for whoever lands either: both heads leave AI-assisted. |
larpinguser
left a comment
There was a problem hiding this comment.
Summary
Fixes repr'd paths in OSError messages across four tools: tools/bcpack_tool.py decode_file drops !r on the same-input guard; bink_names.py, opus_tags.py and world_names.py split OSError from ValueError and print error.filename/error.strerror so Windows separators are not doubled. Tests in the four corresponding test files were failing before this change and pass after.
Why merge
Makes five Windows test cases pass and shows paths as written rather than C:\\... reprs, following the idiom already used in anim_clips.py and analyze_4240_full.py.
Verdict: Approve
SummaryFixes repr'd paths in Why mergeMakes five Windows test cases pass and shows paths as written rather than Verdict: Approve |
|
Tested Notes for picking between the overlapping PRs (#6049, #5927): |
bink_names, opus_tags and world_names split OSError from ValueError and print the error's filename and strerror, so Windows path separators are no longer doubled by repr(). bcpack_tool's same-input guard was changed on main meanwhile, so this branch no longer touches it. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
06d9cd0 to
46fbe6e
Compare
|
Rebased onto |
|
Tested 46fbe6e on Linux, Python 3.14.4: pass, one regression in the message
|
Update (rebased onto
origin/main867d922f0): main'stools/bcpack_tool.pychanged its same-input guard in the meantime (it now quotes the paths with'...', not!r), so this PR no longer touches it: three files, +12/-3.test_bcpack_tool.pypasses on main's version. The other three tests still fail on main and pass here:test_bink_names(1 failure on main, OK 33 here),test_opus_tags(1 failure, OK 24),test_world_names(1 failure, OK 30).git diff --checkclean. Overlap: #6049 and #5927 change the same three tools; this PR is the oldest of the three (12:01 UTC) and is mergeable again, so the maintainer can keep any one of them.Claim: #5581 (comment)
What and why
Before the rebase, five tests failed on Windows at
561b65a8because the tools put a repr'd path in their error text.str(OSError)reprs the filename it carries, so every separator doubles on Windows (C:\\Users\\...); on a POSIX path there is nothing to escape, which is why the tests were green where they were written.tools/bcpack_tool.pyhad the same bug written directly, with!ron both paths.Failing before this change, passing after:
tests/test_bink_names.py::test_unreadable_mount_directory_preserves_the_reporttests/test_opus_tags.py::test_cli_reports_incomplete_directory_discoverytests/test_world_names.py::test_an_unreadable_subtree_does_not_replace_the_dictionarytests/test_bcpack_tool.py::test_decode_refuses_same_input_output_pathtests/test_bcpack_tool.py::test_decode_refuses_hardlink_outputThe four messages now follow the idiom the other tools already use (
{e.filename or <fallback>}: {e.strerror or e}, as intools/anim_clips.pyandtools/analyze_4240_full.py), so the user sees the path as written.bink_namesandworld_nameskeep theirValueErrorhandling on a separateexceptclause, because those carry no filename and their messages are already plain.This is the same rule #1692/#1848 settled for
world_names'--outdiagnostic ("print paths as written, so Windows paths match"); these four sites were missed.Tests run
The three that still fail are not this change:
test_joaat_agreement.py(four open PRs already fix it),test_missing_input_exit_codes.py(numpy is not installed here) andtest_first_look_rebuild.py(it tries to rebuildruntime/build/gta6rt.exe, so it needs a configured build).python -m compileall -qon the four files: clean.git diff --check: clean.Complements the open #4277, #4404 and #4728: those add the unlistable-folder handling around these messages, and their new tests will hit the same escaping on Windows without this.
No GPU used, no game data. AI-assisted.
Depends on: none.