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

Closed
leonida/mandy
trigger337 wants to merge 0 commits from fix/rpf9-names-stage-cleanup into main

Pull request closed

This pull request cannot be reopened because the branch was deleted.

trigger337 commented 2026-11-24 14:05:25 +00:00

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
aslan2142 commented 2026-11-24 19:50:34 +00:00

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).

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).
Sign in to join this conversation.
No description provided.