Repository navigation
gamedata_graph: keep scanning after an unsupported XML encoding - #6765
Conversation
Handle codec lookup failure at the document boundary, preserving the hinted root and all other payloads.
|
Tested 82a009a on Linux (Ubuntu 24.04.5 LTS, x86_64, Python 3.12.16, CPU-only, no game files): pass. Commands run:
Code review notes:
(AI-assisted review) |
shayderrr
left a comment
There was a problem hiding this comment.
Summary
tools/gamedata_graph.py scan_document() now catches LookupError when parsing XML and caches doc["data"] locally, treating an unsupported encoding as an unparsed payload rather than aborting. A test with an unknown-encoding document beside a valid one checks the summary counts, and the docs record the behavior.
Why merge
A single XML file declaring an unknown codec should not stop the whole graph build; it now contributes no edges but leaves other documents intact. This makes the graph tool robust on mixed-encoding carves.
Verdict: Approve
Summary
Why mergeA single XML file declaring an unknown codec should not stop the whole graph build; it now contributes no edges but leaves other documents intact. This makes the graph tool robust on mixed-encoding carves. Verdict: Approve |
Claimed in the coordination issue as: GAMEDATA-GRAPH-UNKNOWN-ENCODING.
What and why
An unknown XML codec raises
LookupError, notParseError. One such payload previously aborted graph construction even when its neighbors could be parsed. Classify this document as unparsed using the usual root hint, without creating edges or discarding other documents.Merge trials were clean against main, #2984, #5526 and #6551. #4090 and #4509 already conflict with main; their conflict hunks are unchanged with this patch.
Tested
Linux x86-64, Python 3.12.13, CPU only; no GPU or driver used.
LookupError; patched CLI exited 0 with two payloads (one parsed, one unparsed).python3.12 -I tests/test_gamedata_graph.py(19 passed);python3.12 -I tests/test_gamedata_graph_bad_index.py(5 passed).git diff --checkandpython3.12 -I scripts/check_no_game_data.pyon the changed files passed.AI-assisted: yes (Codex).
Checklist