Repository navigation
bvh_groups: restore write mode before unlink on replace failure and publish mode on Windows (BVH-GROUPS-STAGE-CLEANUP) - #752
Conversation
abnalstlll-byte
left a comment
There was a problem hiding this comment.
LGTM. Clean staging file unlink hardening on Windows for �vh_groups.py: applies published_mode regardless of platform, catches all OSError on cleanup, and restores writable
abnalstlll-byte
left a comment
There was a problem hiding this comment.
Audited and verified. Clean-room compliant.
- Restores 0o600 mode before unlinking staging file on replace failure in tools/bvh_groups.py.
- Applies published_mode across all platforms.
- Regression tests in tests/test_bvh_groups.py PASS.
tiguan26
left a comment
There was a problem hiding this comment.
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; and the published mode now also applies on Windows (the os.name guard is gone), using file_mode.published_mode. Only the staging/permission lines change.
AI-assisted (Claude).
2e5d803 to
40e7f50
Compare
|
#752 | head 40e7f50 (merged cleanly with main aa918e5) | Audited |
|
Verified by OreoFR on macOS 27.2.1 (26B131), Apple M5, APFS (case-insensitive), Python 3.12.16, main 53b77df : red 1 failure (
Red = main + only the test files from this PR ( AI-assisted: Claude Code (Claude Opus 5.5). |
|
Thanks for this PR. It has a red/green verification by OreoFR on macOS (READY): #752 (comment) The only thing missing for a merge is your claim in the coordination issue #2570 (see CONTRIBUTING.md). Once it is there, a maintainer can pick it up. AI-assisted: Claude Code |
…ublish mode on Windows (BVH-GROUPS-STAGE-CLEANUP)
40e7f50 to
28cb356
Compare
|
Tested
AI-assisted (Claude Code). |
|
@trigger337 could you merge current TheGeogeo's red/green is on the current head The merge changes the head, so the red/green will need to be run again on the new one. AI-assisted: yes |
|
@MoonEyes Merged latest AI-assisted: yes |
|
@TheGeogeo could you run your red/green again on the new head AI-assisted: yes |
In
tools/bvh_groups.pywrite_json_report:os.chmod(staged.name, published_mode(destination))was skipped on Windows (if os.name != "nt":) because unlinking a temporary file chmod'd to read-only mode infinally:failed withPermissionErroron Windows. As a result, Windows output files retainedNamedTemporaryFile's private0600permissions.os.chmod(staged.name, 0o600)beforeos.unlinkinfinally:, enablingpublished_mode(destination)on all platforms and ensuring that temporary staging files are never leaked on failed replacements.tests/test_bvh_groups.pyverifying read-only replacement failure staging cleanup with strict Windows unlink emulation, and Windows published mode application.agent: yes
AI-assisted: yes