manifest: restore write mode before unlink on replace failure and publish mode (MANIFEST-STAGE-CLEANUP) #895

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

@⁠trigger337 on GitHub · 2026-11-24 15:02 UTC · original
trigger337:fix/manifest-stage-cleanup → main · +37 −1 · 2 files · 1 commits · open

Apply published_mode(out) to staged manifest file before atomic replacement, and restore write permission (0o600) before TemporaryDirectory cleanup in an exception handler when os.replace fails. This ensures read-only destination permissions do not trigger Windows PermissionError [WinError 5] or strand staging files on replacement failure.

Includes unit test verifying mode restoration on replacement failure.

Clean-room / zero game data verified via scripts/check_no_game_data.py.

agent: yes
AI-assisted: yes

**@⁠trigger337** on GitHub · 2026-11-24 15:02 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/895) `trigger337:fix/manifest-stage-cleanup` → `main` · +37 −1 · 2 files · 1 commits · open Apply `published_mode(out)` to staged manifest file before atomic replacement, and restore write permission (`0o600`) before `TemporaryDirectory` cleanup in an exception handler when `os.replace` fails. This ensures read-only destination permissions do not trigger Windows `PermissionError` [WinError 5] or strand staging files on replacement failure. Includes unit test verifying mode restoration on replacement failure. Clean-room / zero game data verified via `scripts/check_no_game_data.py`. agent: yes AI-assisted: yes
Apply published_mode(out) to staged manifest file before atomic replacement,
and restore write permission (0o600) before TemporaryDirectory cleanup in
exception block when replace fails, preventing Windows PermissionError [WinError 5]
and stranded temporary files.

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

@⁠LewisStephens99 on GitHub · 2026-11-24 15:13 UTC · original

Independent verification on Windows 11, Python 3.14:n- python -I tests/test_manifest.py: 39/40 passed, 1 skipped; the sole failure is the same Windows POSIX-mode assertion (0o600vs0o666) already seen in the related manifest cleanup PRs.n- python -I tests/test_text_write_line_endings.py: 3/3 passed.`n- No game data or GPU used. AI-assisted.

**@⁠LewisStephens99** on GitHub · 2026-11-24 15:13 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/895#issuecomment-7135667728) Independent verification on Windows 11, Python 3.14:`n- `python -I tests/test_manifest.py`: 39/40 passed, 1 skipped; the sole failure is the same Windows POSIX-mode assertion (`0o600` vs `0o666`) already seen in the related manifest cleanup PRs.`n- `python -I tests/test_text_write_line_endings.py`: 3/3 passed.`n- No game data or GPU used. AI-assisted.
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/895/head:github-bot/gh-895'
git switch 'github-bot/gh-895'

Merge

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