glb_writer: restore write mode before unlink on replace failure in _write_bytes_atomic (GLB-WRITER-STAGE-CLEANUP) #830

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

@⁠trigger337 on GitHub · 2026-11-24 14:19 UTC · original
trigger337:fix/glb-writer-stage-cleanup → main · +18 −0 · 2 files · 1 commits · open

When publishing GLB bytes atomically, if _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:19 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/830) `trigger337:fix/glb-writer-stage-cleanup` → `main` · +18 −0 · 2 files · 1 commits · open When publishing GLB bytes atomically, if _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 publishing GLB bytes atomically, if _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:23:29 +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 before removal in _write_bytes_atomic). Test passes (tests/test_glb_writer.py).

**@⁠abnalstlll-byte** on GitHub · 2026-11-24 14:28 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/830#pullrequestreview-6041058637) · **approved these changes** Clean-room verified (zero game data). Correct atomic staging cleanup on Windows read-only files (chmod 0o600 before removal in _write_bytes_atomic). Test passes (tests/test_glb_writer.py).
Author
Owner

@⁠tiguan26 on GitHub · 2026-11-25 03:58 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:58 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/830#pullrequestreview-6051654356) · **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/830/head:github-bot/gh-830'
git switch 'github-bot/gh-830'

Merge

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