page_index: handle mixed None/int versions, guard scan_rpf limit/listdir errors, and write JSON/CSV atomically (PAGE-INDEX-SUMMARY-AND-ATOMIC-IO) #1566
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1566"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ubiquitarianism/leonida. Originally posted by IlyassRS3 on 2026-11-25T04:42:24Z.
Item ID:
PAGE-INDEX-SUMMARY-AND-ATOMIC-IO(new item; coordination issue #14 is at GitHub's 2,500-comment cap with no open successor at PR time — confirmed 0 open PRs touchtools/page_index.py)Summary
TypeErrorinsummarise()on mixedNoneandintversions:sorted({p["version"] for p in pages})crashed whenever pages contained bothNoneand integer versions; count in one pass withCounterand sort with(v is None, 0 if v is None else v).limitinscan_rpf(): previouslylimit=0was falsy and scanned the whole archive, and negativelimitsilently scanned nothing; nowlimit is not None and limit < 1raisesValueError("limit must be at least 1")matching the CLI validator.OSErroronos.listdir(a.source)during overwrite checking inmain(): an unreadable carve directory with an existing output file previously raised an uncaughtPermissionErrortraceback instead of exiting 2 cleanly.NamedTemporaryFile+file_mode.published_mode+replace_retry.replace, enforceallow_nan=Falseand trailing LF\non JSON, and clean up temporary files on failure so existing outputs are never truncated.Testing
python3 -W error -I tests/test_page_index.py -v: 25/25 passedpython3 -W error -I tests/test_text_write_line_endings.py -v: 3/3 passedpython3 -I scripts/check_no_game_data.py tools/page_index.py tests/test_page_index.py: passedpython3 -m compileall -q make_game.py tools tests: passedmain:tools/page_index.py: all 4 new tests fail (FAILED (failures=3, errors=2)).Imported from ubiquitarianism/leonida. Originally posted by copilot-pull-request-reviewer[bot] on 2026-11-25T04:42:32Z.
Review: COMMENTED
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T10:52:10Z.
Red/green: the PR's tests fail on main and pass with this PR (Linux, Python 3.13.18).
Targeted batch of 19 PRs (their tests, the tests importing the changed modules, the docs tests) on main
3ca0707: no new failure, Linux / Python 3.13.AI-assisted (Claude Code, Claude Opus 5.5)