[PR #752] bvh_groups: restore write mode before unlink on replace failure and publish mode on Windows (BVH-GROUPS-STAGE-CLEANUP) #790

Open
opened 2026-11-26 20:19:03 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/752
Author: @trigger337
Created: 11/24/2026
Status: 🔄 Open

Base: main ← Head: fix/bvh-groups-stage-cleanup


📝 Commits (1)

  • 2e5d803 bvh_groups: restore write mode before unlink on replace failure and publish mode on Windows (BVH-GROUPS-STAGE-CLEANUP)

📊 Changes

2 files changed (+41 additions, -3 deletions)

View changed files

📝 tests/test_bvh_groups.py (+35 -0)
📝 tools/bvh_groups.py (+6 -3)

📄 Description

In tools/bvh_groups.py write_json_report:

  1. 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 in finally: failed with PermissionError on Windows. As a result, Windows output files retained NamedTemporaryFile's private 0600 permissions.
  2. Ensure os.chmod(staged.name, 0o600) before os.unlink in finally:, enabling published_mode(destination) on all platforms and ensuring that temporary staging files are never leaked on failed replacements.
  3. Added regression tests in tests/test_bvh_groups.py verifying read-only replacement failure staging cleanup with strict Windows unlink emulation, and Windows published mode application.

agent: yes
AI-assisted: yes


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/752 **Author:** [@trigger337](https://github.com/trigger337) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/bvh-groups-stage-cleanup` --- ### 📝 Commits (1) - [`2e5d803`](https://github.com/ubiquitarianism/leonida/commit/2e5d803a85972abc56baf5e3e85aa12b8d4346ca) bvh_groups: restore write mode before unlink on replace failure and publish mode on Windows (BVH-GROUPS-STAGE-CLEANUP) ### 📊 Changes **2 files changed** (+41 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `tests/test_bvh_groups.py` (+35 -0) 📝 `tools/bvh_groups.py` (+6 -3) </details> ### 📄 Description In `tools/bvh_groups.py` `write_json_report`: 1. `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 in `finally:` failed with `PermissionError` on Windows. As a result, Windows output files retained `NamedTemporaryFile`'s private `0600` permissions. 2. Ensure `os.chmod(staged.name, 0o600)` before `os.unlink` in `finally:`, enabling `published_mode(destination)` on all platforms and ensuring that temporary staging files are never leaked on failed replacements. 3. Added regression tests in `tests/test_bvh_groups.py` verifying read-only replacement failure staging cleanup with strict Windows unlink emulation, and Windows published mode application. agent: yes AI-assisted: yes --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#790
No description provided.