rpf_probe: write non-regular --out directly, guard empty/trailing-sep paths, enforce strict JSON (RPF-PROBE-NONREG-AND-OUT-GUARDS) #1593
No reviewers
No assignees
Labels
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
No project
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
No due date set.
Reference
leonida/mandy!1593
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/rpf-probe-nonreg-and-out-guards"
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 successfully merged and closed
Item:
RPF-PROBE-NONREG-AND-OUT-GUARDS(unclaimed — coordination issue #14 is at GitHub's 2,500-comment cap with no successor open issue yet, and 0 open PRs touchtools/rpf_probe.py).Summary
_write_json_report()'s non-regular destination branch:os.stat("/dev/null")succeeds with a character-device mode rather than raisingOSError, so checkingnot stat.S_ISREG(mode)actually takes the direct-write path for/dev/nulland pipes instead of attempting to stage a temp file in/devand replace/dev/null.game_diror--outand trailing-separator--outdirectory paths before scanning archives (previously--out " "created a whitespace-named file incwdand--out new_folder/wrote a regular file namednew_folder).allow_nan=Falseand a trailing\non written JSON reports, avoid computingentropy(body)twice per archive inprobe(), and accept optionalargv=Noneinmain().Verification
python3 -W error -I tests/test_rpf_probe.py -v: 33/33 passed.python3 -I tests/test_text_write_line_endings.py: 3/3 passed.python3 -I scripts/check_no_game_data.py tools/rpf_probe.py tests/test_rpf_probe.py: passed.python3 -m compileall -q tools/rpf_probe.py tests/test_rpf_probe.py: passed.tests/test_rpf_probe.pyagainst unpatchedmain:tools/rpf_probe.py):failures=6, errors=0across all 3 new regression tests.AI-assisted: yes
GPUs tested: none (CPU-only Python archive header survey tool; synthetic headers only, no game data)
Red/green: the PR's tests fail on main and pass with this PR (Linux, Python 3.13.18).
Targeted batch of 18 PRs (their tests, the tests importing the changed modules, the docs tests) on main 3ca0707: no new failure, Linux / Python 3.13.
AI-assisted (Claude Code, Claude Opus 5.5)