dds_png: restore write mode before unlink on replace failure in main (DDS-PNG-STAGE-CLEANUP) #832
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!832
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/dds-png-stage-cleanup"
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
When previewing/saving PNG in CLI main(), if os.replace fails after shutil.copymode set the destination's permissions, resetting os.chmod to 0o600 ensures TemporaryDirectory cleanup does not fail with PermissionError on Windows if the output was read-only.
agent: yes
AI-assisted: yes
Clean-room verified (zero game data). Correct atomic staging cleanup on Windows read-only files (chmod 0o600 on replace failure in main). Test passes (tests/test_dds_png.py).
Verified by OreoFR
4a54aedcb+ PR headb5dd9acbbpython -I tests/test_dds_png.pyAI-assisted (Claude Code, Claude Opus 5.5).
#832 | head b5dd9acbb6de86b17d19be3c3ae5e34601191341 (merged cleanly with main a8465211fb) |
python -I tests/test_dds_png.py+ live Windows NTFSstat.S_IREADread-onlyout.pngcheck | red on main:FAILED (failures=1)(maincopied read-only bits viashutil.copymode(output, pending)without restoring0o600inexcept BaseException:beforeTemporaryDirectoryteardown whenos.replace(pending, output)failed) | green on PR+main:103 ran, OK(103/103unit testsOK, plus cleanrc=1on Windows NTFS with0.dds-preview-*leftovers and the existing read-onlyout.pngpreserved byte-for-byte) | Windows 11 (10.0.26200.9974), Python 3.12.10 | AI-assisted: yesAudited
tools/dds_png.pyandtests/test_dds_png.pyon Windows 11 NTFS, confirmingos.chmod(pending, 0o600)write-mode restoration onos.replacefailure before staging-directory cleanup. Also verifiedtests/test_ci_registration.py,tests/test_text_write_line_endings.py, andscripts/check_no_game_data.py.Tested
b5dd9acbbmerged (no commit) withmain4755667f5: Python 3.12, Windows 11 10.0.26300, CPU only. Ran the PR's tests plus every test file that imports the changed tool.test_batch_glb.py22 OK,test_dds_png.py103 OK,test_world_build.py68 OK.main:tests/test_dds_png.pyFAILED (failures=1); the other 2 files unchanged.8db8335d2).AI-assisted (Claude Code).
Merging. Red/green verified on
b5dd9acbbagainst currentmainby an agent other than the author (verdicts above), no conflict withmain, does not force a rebase of #2566, claim ID present. Main CI reds are pre-existing (translator-testsmesh,semantic-testsf16), not from this change. Merged by MoonEyes.AI-assisted (Claude Code).