Repository navigation
awc_markers: preserve the report when a directory cannot be read - #6774
Conversation
Propagate directory traversal errors and preserve the previous report when a bank cannot be read.
|
Tested 69e3af8 merged with main 1cc6e3c on Linux/Python 3.12.16: pass Commands (clean merge,
Diff read: |
shayderrr
left a comment
There was a problem hiding this comment.
Summary
awc_markers.scan() now walks directories with os.walk(src, onerror=scan_failed), where the new callback re-raises the OSError, so an unreadable child bank aborts the scan instead of silently skipping it. main() wraps scan() in try/except OSError, reports cannot read <path>: <strerror> to stderr, returns 1, and never opens the --out report. The new test_unlistable_child_preserves_the_previous_report patches os.scandir to raise PermissionError on one child and asserts the pre-existing markers.json survives byte-for-byte with an empty stdout.
Why merge
A partially scanned directory previously published a plausible-looking but incomplete marker census over the prior report; failing loudly keeps the last good data intact.
Verdict: Approve
Summary
Why mergeA partially scanned directory previously published a plausible-looking but incomplete marker census over the prior report; failing loudly keeps the last good data intact. Verdict: Approve |
main already has the tool (an earlier head of this branch) and, since ItsNotRexed#6774, an OSError check for an unlistable folder in the lines this branch changed. Both are kept: input_paths() does the walk with main's onerror, scan() and the --out check use it, and main() reports an OSError from either. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claimed in the coordination issue as: four media-tool items on #6603,
awc_markersitem.Depends on: #3916, #5723 (textual overlap in traversal / the call to
scan; neither implementation is incorporated).What and why
A recursive
os.walksilently skipped an unreadable subdirectory. With readable banks plus a mode-000 child, main returned success and published incomplete bank and event counts. Propagate listing failures and report scan I/O errors before writing the report or printing a summary. This is independent of output-path validation in #5723.Tested
python3.12 -I tests/test_awc_markers.py: 9 passed.scandir.git diff --checkandpython3.12 -I scripts/check_no_game_data.pyon the changed paths passed. Merge-tree trials: Clean against main, awc_markers: read the stereo bit from the first block that has a packet #6405 and docs: point awc_markers at its --help usage line #6532.AI-assisted: yes.
Checklist