anim_skel_match: report JSON write errors (ANIM-SKEL-REPORT-ERROR) #1142

Merged
leonida/mandy
Taffyyy-ops merged 1 commit from fix/anim-skel-report-error into main 2026-11-29 14:38:07 +00:00

Pull request successfully merged and closed

Taffyyy-ops commented 2026-11-24 19:10:43 +00:00

Item ID: ANIM-SKEL-REPORT-ERROR

Handles filesystem/I/O failures cleanly when writing the --json report in tools/anim_skel_match.py:main().

Changes

  • tools/anim_skel_match.py (main): Wraps writing the --json output file in try ... except OSError, printing a clear diagnostic to stderr (anim_skel_match: cannot write <path>: <err>) and returning exit code 2 instead of an unhandled traceback.
  • tests/test_anim_skel_report_error.py: Adds synthetic tests verifying clean stderr diagnostics and exit code 2 on failed JSON writes, plus normal exit 0 on valid writes.

Verification

  • AI-assisted; synthetic tests only, no game data (python -I scripts/check_no_game_data.py).
Item ID: `ANIM-SKEL-REPORT-ERROR` Handles filesystem/I/O failures cleanly when writing the `--json` report in `tools/anim_skel_match.py:main()`. ### Changes - **`tools/anim_skel_match.py` (`main`):** Wraps writing the `--json` output file in `try ... except OSError`, printing a clear diagnostic to `stderr` (`anim_skel_match: cannot write <path>: <err>`) and returning exit code `2` instead of an unhandled traceback. - **`tests/test_anim_skel_report_error.py`:** Adds synthetic tests verifying clean `stderr` diagnostics and exit code `2` on failed JSON writes, plus normal exit `0` on valid writes. ### Verification - AI-assisted; synthetic tests only, no game data (`python -I scripts/check_no_game_data.py`).
abnalstlll-byte approved these changes 2026-11-24 19:13:38 +00:00
abnalstlll-byte left a comment

Reviewed and verified. Wraps JSON report writing in tools/anim_skel_match.py with try...except OSError, printing clean diagnostics to stderr and returning exit code 2 on failure without unhandled tracebacks. Verified with tests/test_anim_skel_report_error.py. 100% clean-room.

Reviewed and verified. Wraps JSON report writing in `tools/anim_skel_match.py` with `try...except OSError`, printing clean diagnostics to stderr and returning exit code 2 on failure without unhandled tracebacks. Verified with `tests/test_anim_skel_report_error.py`. 100% clean-room.
Deedlyy commented 2026-11-24 20:13:45 +00:00

Recommendation: [MERGE]

Reasoning: anim_skel_match reports 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 with main. Merge once the queued checks are green.

Impact level: 2/10

**Recommendation:** [MERGE] **Reasoning:** `anim_skel_match` reports 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 with `main`. Merge once the queued checks are green. **Impact level:** 2/10
Taffyyy-ops commented 2026-11-25 10:45:09 +00:00

@abnalstlll-byte @Deedlyy Thanks for the review and [MERGE] recommendation! Updated the PR description with a full summary of the --json write error handling in tools/anim_skel_match.py and tests/test_anim_skel_report_error.py.

@abnalstlll-byte @Deedlyy Thanks for the review and `[MERGE]` recommendation! Updated the PR description with a full summary of the `--json` write error handling in `tools/anim_skel_match.py` and `tests/test_anim_skel_report_error.py`.
zmasi commented 2026-11-28 22:35:29 +00:00

#1142 | head d9f9471b81af7384df9b696841f0d54cb9cd16e8 (merged cleanly with main adfb3821a2) | python -I tests/test_anim_skel_report_error.py -v + python -I tests/test_anim_skel_match.py -v + live Windows NTFS stat.S_IREAD target check | red on main: FAILED (errors=2) (unhandled PermissionError when --json names a directory or a read-only stat.S_IREAD NTFS file, and unhandled OSError on 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), and rc=2 with clean anim_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: yes

Audited d9f9471b81 (tools/anim_skel_match.py and tests/test_anim_skel_report_error.py) on Windows 11 — first execution of this PR — confirming --json open/write OSError handling exits 2 without a traceback and keeps LF line endings (newline="\n"). Also verified tests/test_ci_registration.py, tests/test_text_write_line_endings.py, and scripts/check_no_game_data.py.

#1142 | head d9f9471b81af7384df9b696841f0d54cb9cd16e8 (merged cleanly with main adfb3821a2) | `python -I tests/test_anim_skel_report_error.py -v` + `python -I tests/test_anim_skel_match.py -v` + live Windows NTFS `stat.S_IREAD` target check | red on main: `FAILED (errors=2)` (unhandled `PermissionError` when `--json` names a directory or a read-only `stat.S_IREAD` NTFS file, and unhandled `OSError` on 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`), and `rc=2` with clean `anim_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: yes Audited `d9f9471b81` (`tools/anim_skel_match.py` and `tests/test_anim_skel_report_error.py`) on Windows 11 — first execution of this PR — confirming `--json` open/write `OSError` handling exits `2` without a traceback and keeps LF line endings (`newline="\n"`). Also verified `tests/test_ci_registration.py`, `tests/test_text_write_line_endings.py`, and `scripts/check_no_game_data.py`.
enlight3d commented 2026-11-29 00:44:07 +00:00

RUN for #1142 (red/green, synthetic inputs only, no build, no game, GPU not used)

Heads tested

  • PR head: d9f9471b81af7384df9b696841f0d54cb9cd16e8
  • main: 829530dbd0196aa817dbec74aaafc79407b94b57 (origin/main at the time of the run)
  • Merged test: PR head merged into that main with 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)

python -I tests/test_anim_skel_report_error.py
python -I tests/test_anim_skel_match.py

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.

RUN for #1142 (red/green, synthetic inputs only, no build, no game, GPU not used) Heads tested - PR head: d9f9471b81af7384df9b696841f0d54cb9cd16e8 - main: 829530dbd0196aa817dbec74aaafc79407b94b57 (origin/main at the time of the run) - Merged test: PR head merged into that main with `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) ``` python -I tests/test_anim_skel_report_error.py python -I tests/test_anim_skel_match.py ``` 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.
OreoFR commented 2026-11-29 08:54:14 +00:00

@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)

@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)
MoonEyes commented 2026-11-29 14:38:11 +00:00

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.

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.
Sign in to join this conversation.
No description provided.