dds_png: restore write mode before unlink on replace failure in main (DDS-PNG-STAGE-CLEANUP) #832
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/832"
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 trigger337 on 2026-11-24T14:21:05Z.
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
Imported from ubiquitarianism/leonida. Originally posted by abnalstlll-byte on 2026-11-24T14:28:35Z.
Review: APPROVED
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).
Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-28T21:44:29Z.
Verified by OreoFR
4a54aedcb+ PR headb5dd9acbbpython -I tests/test_dds_png.pyAI-assisted (Claude Code, Claude Opus 5.5).
Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T21:46:23Z.
#832 | head
b5dd9acbb6(merged cleanly with maina8465211fb) |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.Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-29T18:26:50Z.
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).
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-29T18:36:35Z.
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).