mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:15:51 +01:00
[PR #1593] rpf_probe: write non-regular --out directly, guard empty/trailing-sep paths, enforce strict JSON (RPF-PROBE-NONREG-AND-OUT-GUARDS) #1612
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#1612
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/1593
Author: @IlyassRS3
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:fix/rpf-probe-nonreg-and-out-guards📝 Commits (1)
c5a4eferpf_probe: write non-regular --out directly, guard empty/trailing-sep paths, enforce strict JSON📊 Changes
2 files changed (+61 additions, -8 deletions)
View changed files
📝
tests/test_rpf_probe.py(+41 -0)📝
tools/rpf_probe.py(+20 -8)📄 Description
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)
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.