anim_skel_match: report JSON write errors (ANIM-SKEL-REPORT-ERROR) #1142
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1142"
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 Taffyyy-ops on 2026-11-24T19:10:43Z.
Item ID:
ANIM-SKEL-REPORT-ERRORHandles filesystem/I/O failures cleanly when writing the
--jsonreport intools/anim_skel_match.py:main().Changes
tools/anim_skel_match.py(main): Wraps writing the--jsonoutput file intry ... except OSError, printing a clear diagnostic tostderr(anim_skel_match: cannot write <path>: <err>) and returning exit code2instead of an unhandled traceback.tests/test_anim_skel_report_error.py: Adds synthetic tests verifying cleanstderrdiagnostics and exit code2on failed JSON writes, plus normal exit0on valid writes.Verification
python -I scripts/check_no_game_data.py).Imported from ubiquitarianism/leonida. Originally posted by abnalstlll-byte on 2026-11-24T19:13:38Z.
Review: APPROVED
Reviewed and verified. Wraps JSON report writing in
tools/anim_skel_match.pywithtry...except OSError, printing clean diagnostics to stderr and returning exit code 2 on failure without unhandled tracebacks. Verified withtests/test_anim_skel_report_error.py. 100% clean-room.Imported from ubiquitarianism/leonida. Originally posted by Deedlyy on 2026-11-24T20:13:45Z.
Recommendation: [MERGE]
Reasoning:
anim_skel_matchreports JSON write errors cleanly instead of tracebacking. Tiny tool fix with a synthetic test; minimal PR description. CI (label, change-scope, no-game-data and the Runtime jobs) is still queued awaiting maintainer workflow approval, so nothing has run in CI yet; GitHub reports no merge conflict withmain. Merge once the queued checks are green.Impact level: 2/10
Imported from ubiquitarianism/leonida. Originally posted by Taffyyy-ops on 2026-11-25T10:45:09Z.
@abnalstlll-byte @Deedlyy Thanks for the review and
[MERGE]recommendation! Updated the PR description with a full summary of the--jsonwrite error handling intools/anim_skel_match.pyandtests/test_anim_skel_report_error.py.Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T22:35:29Z.
#1142 | head
d9f9471b81(merged cleanly with mainadfb3821a2) |python -I tests/test_anim_skel_report_error.py -v+python -I tests/test_anim_skel_match.py -v+ live Windows NTFSstat.S_IREADtarget check | red on main:FAILED (errors=2)(unhandledPermissionErrorwhen--jsonnames a directory or a read-onlystat.S_IREADNTFS file, and unhandledOSErroron mid-write failure) | green on PR+main:3 ran, OK(test_anim_skel_report_error.py),8 ran, OK(test_anim_skel_match.py),5 ran, OK(test_anim_skeleton_match.py), andrc=2with cleananim_skel_match: cannot write ...diagnostic on a read-only NTFS file (preserving existing file bytes) | Windows 11 (10.0.26200.9974), Python 3.12.10 | AI-assisted: yesAudited
d9f9471b81(tools/anim_skel_match.pyandtests/test_anim_skel_report_error.py) on Windows 11 — first execution of this PR — confirming--jsonopen/writeOSErrorhandling exits2without a traceback and keeps LF line endings (newline="\n"). Also verifiedtests/test_ci_registration.py,tests/test_text_write_line_endings.py, andscripts/check_no_game_data.py.Imported from ubiquitarianism/leonida. Originally posted by enlight3d on 2026-11-29T00:44:07Z.
RUN for #1142 (red/green, synthetic inputs only, no build, no game, GPU not used)
Heads tested
d9f9471b81829530dbd0(origin/main at the time of the run)git merge --no-edit --no-ff(local only, merge was clean, nothing pushed)Commands (one process per file, from the repo root, CPython 3.13.12 with -I)
Red: tests kept, the PR's change to tools/ reverted to the merge base. behavioural: with tools/anim_skel_match.py reverted, 2 of 3 tests error (errors=2): the write failure and the report-path-is-a-directory case escape as an uncaught OSError/PermissionError instead of a clean stderr line and exit 2. The valid-write test passes on both sides, as expected.
Green at PR head: yes (tests/test_anim_skel_report_error.py: 3 passed; tests/test_anim_skel_match.py: 8 passed)
Green merged into main: yes, same files all pass on the merged tree (counts as above)
Plain main (other covering tests, without the PR): pass, so nothing pre-existing fails and nothing breaks once merged.
Kind of red: behavioural (test fails for the reason the PR fixes).
Machine: Windows 11 Pro 10.0.26300, CPython 3.13.12; GPU not used.
Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-29T08:54:14Z.
@Taffyyy-ops this PR is green on
main+ PR (red/green runs posted above by zmasi and enlight3d). The only thing missing for a merge is your claim of its item in the coordination issue #2570. Once it is there, a maintainer can merge it. (This is a one-time note on each of your green PRs: #1115 #1119 #1124 #1136 #1142 #1159.) — OreoFR's agent (AI-assisted)Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-29T14:38:11Z.
Merged at head
d9f9471. Tested on this head by enlight3d, zmasi: the new test fails on main and passes with the PR (results in the comments above). AI-assisted: yes.