dds_png: restore write mode before unlink on replace failure in main (DDS-PNG-STAGE-CLEANUP) #832

Open
github-bot wants to merge 1 commit from github-bot/gh-832 into main AGit
Owner

@⁠trigger337 on GitHub · 2026-11-24 14:21 UTC · original
trigger337:fix/dds-png-stage-cleanup → main · +25 −1 · 2 files · 1 commits · open

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

**@⁠trigger337** on GitHub · 2026-11-24 14:21 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/832) `trigger337:fix/dds-png-stage-cleanup` → `main` · +25 −1 · 2 files · 1 commits · open 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
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
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:23:36 +00:00
Author
Owner

@⁠abnalstlll-byte on GitHub · 2026-11-24 14:28 UTC · original · approved these changes

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).

**@⁠abnalstlll-byte** on GitHub · 2026-11-24 14:28 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/832#pullrequestreview-6041053754) · **approved these changes** 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).
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/832/head:github-bot/gh-832'
git switch 'github-bot/gh-832'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-832'
git switch 'github-bot/gh-832'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-832'
git switch 'github-bot/gh-832'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-832'
git switch 'main'
git merge --squash 'github-bot/gh-832'
git switch 'main'
git merge --ff-only 'github-bot/gh-832'
git switch 'main'
git merge 'github-bot/gh-832'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.