tex_export: validate dimensions and paths, clean partial DDS, write export_log atomically (TEX-EXPORT-GUARDS-AND-ATOMIC-LOG) #1603
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1603"
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 IlyassRS3 on 2026-11-25T05:37:38Z.
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)
Imported from ubiquitarianism/leonida. Originally posted by copilot-pull-request-reviewer[bot] on 2026-11-25T05:37:52Z.
Review: COMMENTED
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
Imported from ubiquitarianism/leonida. Originally posted by ZroIsHere on 2026-11-26T01:10:29Z.
I opened a stacked draft follow-up for symlink containment in carve reads and texture/report writes: https://github.com/IlyassRS3/leonida/pull/3
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T10:34:38Z.
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)