rsc8_audio: restore write mode before unlink on replace failure (RSC8-AUDIO-STAGE-CLEANUP) #814

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

@⁠trigger337 on GitHub · 2026-11-24 14:08 UTC · original
trigger337:fix/rsc8-audio-stage-cleanup → main · +17 −0 · 2 files · 1 commits · open

When writing report JSON or CSV, if os.replace fails (for instance due to permission errors), resetting os.chmod to 0o600 ensures unlinking the temporary file does not fail on Windows with PermissionError.

agent: yes
AI-assisted: yes

**@⁠trigger337** on GitHub · 2026-11-24 14:08 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/814) `trigger337:fix/rsc8-audio-stage-cleanup` → `main` · +17 −0 · 2 files · 1 commits · open When writing report JSON or CSV, if os.replace fails (for instance due to permission errors), resetting os.chmod to 0o600 ensures unlinking the temporary file does not fail on Windows with PermissionError. agent: yes AI-assisted: yes
When writing report JSON or CSV, if os.replace fails (for instance due to
permission errors), resetting os.chmod to 0o600 ensures unlinking the
temporary file does not fail on Windows with PermissionError.

agent: yes
AI-assisted: yes
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:22:40 +00:00
Author
Owner

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

Clean-room verified (zero game data). Correct atomic staging cleanup on Windows read-only files (chmod 0o600 before removal in _atomic_write_text). Tests pass (tests/test_rsc8_audio.py: 49/49 PASS).

**@⁠abnalstlll-byte** on GitHub · 2026-11-24 14:24 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/814#pullrequestreview-6040973913) · **approved these changes** Clean-room verified (zero game data). Correct atomic staging cleanup on Windows read-only files (chmod 0o600 before removal in _atomic_write_text). Tests pass (tests/test_rsc8_audio.py: 49/49 PASS).
Author
Owner

@⁠tiguan26 on GitHub · 2026-11-25 03:59 UTC · original · approved these changes

Approving. Merged into current main with no conflicts; the PR's tests pass (Linux, Python 3.13). Same pattern as the rest of the *-STAGE-CLEANUP series: on a failed replace the staged file gets 0o600 back before os.unlink, so a staged copy left read-only (the published mode on Windows) is still removed. Only the staging/permission lines change.

AI-assisted (Claude).

**@⁠tiguan26** on GitHub · 2026-11-25 03:59 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/814#pullrequestreview-6051661260) · **approved these changes** Approving. Merged into current main with no conflicts; the PR's tests pass (Linux, Python 3.13). Same pattern as the rest of the *-STAGE-CLEANUP series: on a failed replace the staged file gets 0o600 back before os.unlink, so a staged copy left read-only (the published mode on Windows) is still removed. Only the staging/permission lines change. AI-assisted (Claude).
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/814/head:github-bot/gh-814'
git switch 'github-bot/gh-814'

Merge

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