Skip to content

gamedata_blobs: stage --json so a write failure keeps the previous report - #8820

Open
Grimkeh wants to merge 1 commit into
ItsNotRexed:mainfrom
Grimkeh:fix/gamedata-blobs-preserve-json
Open

Grimkeh wants to merge 1 commit into
ItsNotRexed:mainfrom
Grimkeh:fix/gamedata-blobs-preserve-json

Conversation

@Grimkeh

@Grimkeh Grimkeh commented Nov 23, 2026

Copy link
Copy Markdown

Summary

Claim: #8504 (comment)

Synthetic; no game files. AI-assisted (Cursor / Composer).

Test plan

  • test_json_write_failure_preserves_previous_report OK
  • test_missing_file_names_what_is_wrong is already red on main (expects exit 1; tool returns 2) — unchanged by this PR

Made with Cursor

…port

Publish through a temp file + replace so a mid-write OSError leaves any prior complete JSON intact.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Grimkeh

Grimkeh commented Nov 23, 2026

Copy link
Copy Markdown
Author

Overlap note: #8816 also edits tools/gamedata_blobs.py (UTF-8 BOM in carved text). Whichever lands second will need a rebase.

@YordiLorenzo

Copy link
Copy Markdown

Tested 8dcc329 on Linux, Python 3.14.4: pass

python3 -I tests/test_gamedata_blobs.py: 8 of 9 pass, test_missing_file_names_what_is_wrong fails the same way on main 867d922 (2 != 1)
with main's gamedata_blobs.py the new test errors (no replace_retry there); main wrote the report in place
a mutant that truncates the destination before replace_retry: the new test fails

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants