mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:50:52 +01:00
[PR #1578] 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) #1598
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#1598
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/1578
Author: @IlyassRS3
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:fix/gamedata-index-utf8-decl-and-io📝 Commits (1)
647e672gamedata_index: keep UTF-8 continuations in declared XML, fix ArchiveSource cleanup, harden carved_stream and atomic I/O📊 Changes
2 files changed (+226 additions, -33 deletions)
View changed files
📝
tests/test_gamedata_index.py(+136 -0)📝
tools/gamedata_index.py(+90 -33)📄 Description
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)).🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.