mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:20:53 +01:00
[PR #1603] tex_export: validate dimensions and paths, clean partial DDS, write export_log atomically (TEX-EXPORT-GUARDS-AND-ATOMIC-LOG) #1619
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#1619
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/1603
Author: @IlyassRS3
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:fix/tex-export-guards-and-atomic-log📝 Commits (1)
d0a0a36tex_export: validate dimensions and archive/fmt_name paths, clean partial DDS, write export_log atomically📊 Changes
2 files changed (+195 additions, -11 deletions)
View changed files
📝
tests/test_tex_export.py(+110 -0)📝
tools/tex_export.py(+85 -11)📄 Description
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)
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.