gamedata_index: keep UTF-8 continuations in declared XML, fix ArchiveSource cleanup, and harden carved_stream/atomic I/O (GAMEDATA-INDEX-UTF8-DECL-AND-IO) #1578
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1578"
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:56:47Z.
Item ID:
GAMEDATA-INDEX-UTF8-DECL-AND-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/gamedata_index.py)Summary
kind == "decl"):build_rows()previously applied_utf8_text(nxt)only to declarationless XML (line 318), while declared XML (<?xml ...?>,line 275) broke on anynk == "binary"chunk — splitting multi-chunk non-ASCII UTF-8 XML documents into an incomplete XML header plus a binary blob that swallowed the closing tag.ArchiveSourcefile handles and temp directories on__init__failure: if the carver subprocess fails,index.jsonfails to parse, ormmap()raises (e.g. empty archive),ArchiveSourcenow callsself.close()before re-raising instead of leaking_fhand_tmp.carved_stream()against case-variant names and hardlink aliases: match[0-9a-fA-F]{12}.(bin|bk2)case-insensitively and check existing output paths against carved streams indirectoryviasame_report_pathso uppercase spellings (.BINon case-insensitive volumes) and hardlink aliases cannot overwrite carved inputs.--json/--csvand write outputs atomically: reject""/" "up front (previously""was silently ignored and" "wrote a literal" "file), stage CSV/JSON viaNamedTemporaryFile+file_mode.published_mode+replace_retry.replace, enforceallow_nan=Falseand trailing LF\non JSON, catchRecursionErroron malformed inputs, and breaksummarize()["types"]ties deterministically.Testing
python3 -W error -I tests/test_gamedata_index.py -v: 42/42 passedpython3 -W error -I tests/test_gamedata_index_report_paths.py -v: 8/8 passedpython3 -W error -I tests/test_text_write_line_endings.py -v: 3/3 passedpython3 -I scripts/check_no_game_data.py tools/gamedata_index.py tests/test_gamedata_index.py: passedpython3 -m compileall -q make_game.py tools tests: passedmain:tools/gamedata_index.py: all 5 new tests fail (FAILED (failures=8, errors=1)).Imported from ubiquitarianism/leonida. Originally posted by copilot-pull-request-reviewer[bot] on 2026-11-25T04:56:55Z.
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:54:00Z.
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)