rpf9_names: restore write mode before unlink on replace failure (RPF9-NAMES-STAGE-CLEANUP) #809

Closed
github-bot wants to merge 1 commit from gh-pr/809/head into gh-pr/809/base
Owner

@⁠trigger337 on GitHub · 2026-11-24 14:05 UTC · original
trigger337:fix/rpf9-names-stage-cleanup → main · +21 −1 · 2 files · 1 commits · closed without merging

When publishing report JSON, if os.replace fails (for instance due to permission errors), resetting os.chmod to 0o600 ensures TemporaryDirectory cleanup does not fail on Windows with PermissionError.

agent: yes
AI-assisted: yes

**@⁠trigger337** on GitHub · 2026-11-24 14:05 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/809) `trigger337:fix/rpf9-names-stage-cleanup` → `main` · +21 −1 · 2 files · 1 commits · closed without merging When publishing report JSON, if os.replace fails (for instance due to permission errors), resetting os.chmod to 0o600 ensures TemporaryDirectory cleanup does not fail on Windows with PermissionError. agent: yes AI-assisted: yes
When publishing report JSON, if os.replace fails (for instance due to
permission errors), resetting os.chmod to 0o600 ensures TemporaryDirectory
cleanup 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:25 +00:00
github-bot closed this pull request 2026-11-26 09:22:25 +00:00
Author
Owner

@⁠aslan2142 on GitHub · 2026-11-24 19:50 UTC · original

Thanks for picking this up. We're closing this in favour of #794, which fixes the same item:

  • If the os.chmod(temp, 0o600) in the except block fails, its error replaces the replace error that main reports. #794 wraps that chmod in suppress(OSError), like navmesh_index and bvh_index do.
  • The new test passes on unchanged main under umask 077, because published_mode already returns 0o600 there. It doesn't make the report read-only, and it doesn't check that the old report is kept or that no stage is left. #794's test checks all three.
  • The cleanup only covers the os.replace line. #794 puts the whole stage in a finally.
  • Next time, please list in the description what you ran, as CONTRIBUTING.md asks.

AI-assisted (Claude Code, Claude Opus 5.5).

**@⁠aslan2142** on GitHub · 2026-11-24 19:50 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/809#issuecomment-7142665892) Thanks for picking this up. We're closing this in favour of #794, which fixes the same item: - If the `os.chmod(temp, 0o600)` in the `except` block fails, its error replaces the replace error that `main` reports. #794 wraps that chmod in `suppress(OSError)`, like `navmesh_index` and `bvh_index` do. - The new test passes on unchanged `main` under umask 077, because `published_mode` already returns `0o600` there. It doesn't make the report read-only, and it doesn't check that the old report is kept or that no stage is left. #794's test checks all three. - The cleanup only covers the `os.replace` line. #794 puts the whole stage in a `finally`. - Next time, please list in the description what you ran, as CONTRIBUTING.md asks. AI-assisted (Claude Code, Claude Opus 5.5).

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.