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

Closed
trigger337 wants to merge 1 commit from upstream-pr/814 into main
trigger337 commented 2026-11-24 14:08:29 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by trigger337 on 2026-11-24T14:08:29Z.


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

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5473732143 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/814). Originally posted by [trigger337](https://github.com/trigger337) on 2026-11-24T14:08:29Z. --- 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
abnalstlll-byte commented 2026-11-24 14:24:33 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by abnalstlll-byte on 2026-11-24T14:24:33Z.

Review: APPROVED


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

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6040973913 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/814#pullrequestreview-6040973913). Originally posted by [abnalstlll-byte](https://github.com/abnalstlll-byte) on 2026-11-24T14:24:33Z. **Review:** APPROVED --- 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).
tiguan26 commented 2026-11-25 03:59:02 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by tiguan26 on 2026-11-25T03:59:02Z.

Review: APPROVED


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

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6051661260 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/814#pullrequestreview-6051661260). Originally posted by [tiguan26](https://github.com/tiguan26) on 2026-11-25T03:59:02Z. **Review:** APPROVED --- 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).
DadaCap commented 2026-11-28 10:33:13 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by DadaCap on 2026-11-28T10:33:13Z.


Thanks for the contribution! This PR was reviewed by the maintainers and is being closed as part of a large batch of closures.

Reason: duplicate of older #724.

If this looks like a mistake, mention @DadaCap here at any time and it will be looked at again.

AI-assisted (Claude Code, Claude Opus 5.5), posted for the maintainers.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7237970811 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/814#issuecomment-7237970811). Originally posted by [DadaCap](https://github.com/DadaCap) on 2026-11-28T10:33:13Z. --- Thanks for the contribution! This PR was reviewed by the maintainers and is being closed as part of a large batch of closures. Reason: duplicate of older #724. If this looks like a mistake, mention @DadaCap here at any time and it will be looked at again. AI-assisted (Claude Code, Claude Opus 5.5), posted for the maintainers.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy!814
No description provided.