world_census: restore write mode before temporary directory cleanup in _staged_json (WORLD-CENSUS-STAGE-CLEANUP) #836

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

@⁠trigger337 on GitHub · 2026-11-24 14:24 UTC · original
trigger337:fix/world-census-stage-cleanup → main · +29 −1 · 2 files · 1 commits · open

When staging JSON output in _staged_json, if the destination had read-only permissions, the staged file received mode 0o444. If publishing fails or raises an exception, resetting os.chmod to 0o600 in finally ensures TemporaryDirectory cleanup does not fail with PermissionError on Windows.

agent: yes
AI-assisted: yes

**@⁠trigger337** on GitHub · 2026-11-24 14:24 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/836) `trigger337:fix/world-census-stage-cleanup` → `main` · +29 −1 · 2 files · 1 commits · open When staging JSON output in _staged_json, if the destination had read-only permissions, the staged file received mode 0o444. If publishing fails or raises an exception, resetting os.chmod to 0o600 in finally ensures TemporaryDirectory cleanup does not fail with PermissionError on Windows. agent: yes AI-assisted: yes
When staging JSON output in _staged_json, if the destination had read-only
permissions, the staged file received mode 0o444. If publishing fails or
raises an exception, resetting os.chmod to 0o600 in finally ensures
TemporaryDirectory cleanup does not fail with PermissionError on Windows.

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

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

Clean-Room Peer Review for PR #836 (world_census: restore write mode before temporary directory cleanup in _staged_json)

Essential filesystem cleanup hardening for Windows:

  • Temporary Staging Cleanup Guard:
    • _staged_json copies permissions from the destination file to the temporary staging file. When the destination is read-only (
**@⁠abnalstlll-byte** on GitHub · 2026-11-24 14:26 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/836#pullrequestreview-6041002688) · **approved these changes** ### Clean-Room Peer Review for PR #836 (world_census: restore write mode before temporary directory cleanup in _staged_json) Essential filesystem cleanup hardening for Windows: - **Temporary Staging Cleanup Guard**: - _staged_json copies permissions from the destination file to the temporary staging file. When the destination is read-only (
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 in _staged_json finally block). Test passes (tests/test_world_census.py).

**@⁠abnalstlll-byte** on GitHub · 2026-11-24 14:28 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/836#pullrequestreview-6041042396) · **approved these changes** Clean-room verified (zero game data). Correct atomic staging cleanup on Windows read-only files (chmod 0o600 in _staged_json finally block). Test passes (tests/test_world_census.py).
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/836/head:github-bot/gh-836'
git switch 'github-bot/gh-836'

Merge

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