tex_export: validate dimensions and paths, clean partial DDS, write export_log atomically (TEX-EXPORT-GUARDS-AND-ATOMIC-LOG) #1603
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!1603
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/tex-export-guards-and-atomic-log"
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:
TEX-EXPORT-GUARDS-AND-ATOMIC-LOG(unclaimed — coordination issue #14 is at GitHub's 2,500-comment cap with no successor open issue yet, and 0 open PRs touchtools/tex_export.py).Summary
detile_offsets()andexport_one(), and reject empty, absolute, or..-traversingarchivepaths and path-separatorfmt_namevalues before opening blobs or creating output subdirectories..ddsfiles ifwrite()fails withOSErrorinexport_one(), matching the existing PNG partial-file cleanup.index/carve/outarguments inmain(argv=None)(preventing" "directory creation incwd), and catchRecursionErrorwhen loadingtextures_index.json.export_log.jsonatomically viafile_mode.published_mode+replace_retry.replacewithallow_nan=False(preserving existing logs on write failure and handling non-regular targets), keeping the exact compact JSON format.Verification
python3 -W error -m pytest tests/test_tex_export.py -q: 144 passed.python3 -I tests/test_text_write_line_endings.py: 3/3 passed.python3 -I scripts/check_no_game_data.py tools/tex_export.py tests/test_tex_export.py: passed.python3 -m compileall -q tools/tex_export.py tests/test_tex_export.py: passed.tests/test_tex_export.pyagainst unpatchedmain:tools/tex_export.py): 10 failed, 134 passed across all new regression tests.AI-assisted: yes
GPUs tested: none (CPU-only Python texture exporter; synthetic swizzle equations and blobs only, no game data)
I opened a stacked draft follow-up for symlink containment in carve reads and texture/report writes: https://github.com/IlyassRS3/leonida/pull/3
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)