text_tables: restore write mode before unlink on replace failure and backup removal (TEXT-TABLES-STAGE-CLEANUP) #818

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

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

When writing tables, if os.replace fails (for instance due to permission errors), resetting os.chmod to 0o600 ensures unlinking the temporary staging and backup files does not fail on Windows with PermissionError.

agent: yes
AI-assisted: yes

**@⁠trigger337** on GitHub · 2026-11-24 14:11 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/818) `trigger337:fix/text-tables-stage-cleanup` → `main` · +27 −0 · 2 files · 1 commits · open When writing tables, if os.replace fails (for instance due to permission errors), resetting os.chmod to 0o600 ensures unlinking the temporary staging and backup files does not fail on Windows with PermissionError. agent: yes AI-assisted: yes
When writing tables, if os.replace fails (for instance due to permission
errors), resetting os.chmod to 0o600 ensures unlinking the temporary staging
and backup files 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:53 +00:00
Author
Owner

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

Clean-room verified (zero game data). Correct atomic staging and backup cleanup on Windows read-only files (chmod 0o600 before removal). Tests pass (tests/test_text_tables.py: 33/33 PASS).

**@⁠abnalstlll-byte** on GitHub · 2026-11-24 14:23 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/818#pullrequestreview-6040952721) · **approved these changes** Clean-room verified (zero game data). Correct atomic staging and backup cleanup on Windows read-only files (chmod 0o600 before removal). Tests pass (tests/test_text_tables.py: 33/33 PASS).
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/818#pullrequestreview-6051659802) · **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/818/head:github-bot/gh-818'
git switch 'github-bot/gh-818'

Merge

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