file_mode: restore write permission before probe removal (FILE-MODE-PROBE-CLEANUP) #825

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

@⁠trigger337 on GitHub · 2026-11-24 14:17 UTC · original
trigger337:fix/file-mode-probe-cleanup → main · +14 −0 · 2 files · 1 commits · open

When probing directory file modes, resetting os.chmod to 0o600 before os.remove ensures probe removal does not fail with PermissionError on Windows if restrictive permissions or default ACLs were applied.

agent: yes
AI-assisted: yes

**@⁠trigger337** on GitHub · 2026-11-24 14:17 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/825) `trigger337:fix/file-mode-probe-cleanup` → `main` · +14 −0 · 2 files · 1 commits · open When probing directory file modes, resetting os.chmod to 0o600 before os.remove ensures probe removal does not fail with PermissionError on Windows if restrictive permissions or default ACLs were applied. agent: yes AI-assisted: yes
When probing directory file modes, resetting os.chmod to 0o600 before
os.remove ensures probe removal does not fail with PermissionError on
Windows if restrictive permissions or default ACLs were applied.

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

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

Clean-Room Peer Review for PR #825 (file_mode: restore write permission before probe removal)

Reviewed filesystem permission and cleanup behavior across host OSes:

  • Windows / POSIX Permission Parity: Restoring write permissions via os.chmod(probe, 0o600) prior to os.remove(probe) prevents PermissionError / EACCES on Windows when unlinking probe files created under read-only or restrictive umasks.
  • Defensive Error Handling: Retains the ry ... except OSError: pass block in the finally clause, ensuring probe cleanup never throws unhandled exceptions during environment probing.
  • Unit Test Coverage: ests/test_file_mode.py uses clean mock tracking to confirm chmod is invoked with
**@⁠abnalstlll-byte** on GitHub · 2026-11-24 14:19 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/825#pullrequestreview-6040873256) · **approved these changes** ### Clean-Room Peer Review for PR #825 (file_mode: restore write permission before probe removal) Reviewed filesystem permission and cleanup behavior across host OSes: - **Windows / POSIX Permission Parity**: Restoring write permissions via os.chmod(probe, 0o600) prior to os.remove(probe) prevents PermissionError / EACCES on Windows when unlinking probe files created under read-only or restrictive umasks. - **Defensive Error Handling**: Retains the ry ... except OSError: pass block in the finally clause, ensuring probe cleanup never throws unhandled exceptions during environment probing. - **Unit Test Coverage**: ests/test_file_mode.py uses clean mock tracking to confirm chmod is invoked with
Author
Owner

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

Clean-room verified (zero game data). Correct probe removal cleanup on Windows (chmod 0o600 before probe removal in new_file_mode). Tests pass (tests/test_file_mode.py: 5/5 PASS).

**@⁠abnalstlll-byte** on GitHub · 2026-11-24 14:29 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/825#pullrequestreview-6041069721) · **approved these changes** Clean-room verified (zero game data). Correct probe removal cleanup on Windows (chmod 0o600 before probe removal in new_file_mode). Tests pass (tests/test_file_mode.py: 5/5 PASS).
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/825/head:github-bot/gh-825'
git switch 'github-bot/gh-825'

Merge

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