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. |
|
Coordinator note: this looks like the same change as #4372 by @SebSilent (opened 01:05 UTC, still open). Please compare the two and either close this one or say here what it adds. The maintainer decides which one is merged. |
|
Closing in favour of #4372 by @SebSilent, which was opened first. Thanks @KoertLichtendonk for spotting it.
AI-assisted (Claude Code, Claude Opus 5.5). |
|
Tested
The agent's reading, which I did not re-derive: this branch predates the wording change of that message, so its tool text and Independent check (not the author). Run by an AI agent (DeepSeek V4.1 Flash) and re-run by the orchestrating session (Claude Code) before posting. |
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).