mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:25:52 +01:00
[PR #1815] [MERGED] tools: make script_qtable.py --json writes atomic and validate paths and hex stems #1826
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#1826
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/1815
Author: @kirigayakazima
Created: 11/25/2026
Status: ✅ Merged
Merged: 11/25/2026
Merged by: @aslan2142
Base:
main← Head:fix/script-qtable-atomic-json📝 Commits (1)
59eadb0tools: make script_qtable.py --json writes atomic and validate paths and hex stems📊 Changes
2 files changed (+129 additions, -10 deletions)
View changed files
📝
tests/test_script_qtable.py(+85 -0)📝
tools/script_qtable.py(+44 -10)📄 Description
Claimed in the coordination issue as: SCRIPT-QTABLE-ATOMIC-JSON-AND-EMPTY-PATH-GUARD (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7162357891)
What and why
tools/script_qtable.py--jsonreports atomically via_write_json_atomic()(tempfile.mkstempbesideos.path.realpath(path), explicitnewline="\n", trailing\n,os.fsync,published_mode, andreplace_retry), preserving any existing file and cleaning up staging files on write/replace failures.if a.json is not None:instead of truthiness and reject empty, whitespace-only, or trailing-separator--jsonpaths incheck_report_path()withUsageError(exit2)._BinFolderSourceto unsigned hexadecimal stems so negative-prefixed.binnames are not mapped to negative offsets.tests/test_script_qtable.py.Tested
python -I tests/test_script_qtable.py -v->Ran 14 tests in 0.730s,OK(verified in a detachedupstream/mainworktree that all new regressions fail before the fix:FAILED (failures=3)).python -I tests/test_ci_registration.py->Ran 16 tests in 4.796s,OK.python -I tests/test_text_write_line_endings.py->Ran 3 tests in 13.173s,OK.python -I scripts/check_no_game_data.py tools/script_qtable.py tests/test_script_qtable.py-> exit0.python -I -m compileall -q tools/script_qtable.py tests/test_script_qtable.pyandgit diff --check-> clean.GPUs tested: n/a (CPU/stdlib Python tests on Windows 11 x64)
AI-assisted: yes
Checklist
needs rebase).🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.