Repository navigation
Conversation
The guard walks the target to see whether --out names an existing input. Without onerror an unlistable sub-folder was skipped, so an input inside it passed the check and got truncated by the report write (verified on main: rc 0, input replaced). The guard walk now uses the same _walk_error as the scan and reports one error line with exit 2 before anything is scanned or written. Rebased onto main without the PR's first commit: main's scan walk already raises through a nested scan_failed, so that helper moves to module level as _walk_error and both walks use it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Tested bf1f813 merged onto main 8575d36 on Windows 11 Pro, Intel i7-14700KF, CPython 3.11.0 (stdlib only for these tests), CPU only: pass.
Review notes:
AI-assisted (Claude Code). |
|
Tested bf1f813 on Arch Linux, Python 3.14.10, CPU only: targeted pass.
No game files, no GPU. AI-assisted. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Claimed in the coordination issue as BUILD-1445: #7049 (comment) (released to us by SebSilent). Supersedes #4372: SebSilent's fix (commit 64082b9), rebased onto current main; #4372 conflicts with main.
The bug
bink_indexchecks whether--outnames an existing input file. It does this by walking the target folder inmain().onerror, soos.walksilently skips any sub-folder it can't list.mainthe run exits 0 and the input is gone.The change
--outcheck's walk usesonerror=_walk_error, so a folder it can't list raises.main()catches theOSErrorand prints onebink_index: error: cannot read <folder>: <reason>line, then exits 2 before anything is scanned or written.test_unlistable_folder_cannot_hide_an_input_from_the_out_checkmakesos.scandirfail for one folder, so it runs on every platform and also as root. It checks:What changed in the rebase
64082b962) is carried over; the cherry-pick applied without conflicts.onerroron the scan walk) isn't needed any more: Refuse partial Bink indexes when a directory cannot be listed #3973 already landed that onmain(a nestedscan_failedhelper, covered bytest_incomplete_directory_walk_does_not_replace_the_report)._walk_error, which only that first commit defined. I movedmain's nestedscan_failedup to module level as_walk_error, and both walks share it. Nothing else changed in their code.Tests
Linux, Python 3.14.10, synthetic input only.
python3 -I tests/test_bink_index.py, 33 tests:main's tool: 2 failures, the new test andtest_a_single_named_file_that_is_not_a_stream_or_rpf_is_refused.test_report_source_collision.py'stest_a_distinct_report_path_still_works, are red onmainalready. bink_index: one wording for both not-a-stream guards; repair the two tests #6917/#6925 left red #7092 fixes both, so they're left alone here.tests/test_bink_names.py: OK.python3 -I -m compileall -q make_game.py tools tests: clean.tests/test_docs_*.py: 9 of 11 OK.test_docs_cli_flagsandtest_docs_linksfail ondocs/dev-tools.md, which this PR doesn't touch, so those failures come frommain.Relation to other PRs
git apply --checkis clean). The two touch different lines and can merge in either order.same_output_pathforwards toreport_paths): touches a different function. It needs the same fuzz to apply here as onmain.main, with or without this branch.Checklist
os.scandironly)main, passes hereAI-assisted (Claude Code, Claude Opus 5.5).