mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:55:52 +01:00
[PR #889] world_index: restore write mode before unlink on replace failure and publish mode (WORLD-INDEX-STAGE-CLEANUP) #927
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#927
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/889
Author: @trigger337
Created: 11/24/2026
Status: 🔄 Open
Base:
main← Head:fix/world-index-stage-cleanup📝 Commits (1)
4822bcfworld_index: restore write mode before unlink on replace failure and publish mode (WORLD-INDEX-STAGE-CLEANUP)📊 Changes
2 files changed (+32 additions, -5 deletions)
View changed files
📝
tests/test_world_index.py(+17 -0)📝
tools/world_index.py(+15 -5)📄 Description
Overview
In
tools/world_index.py, applypublished_mode(destination)in_staged_entity_reportbefore atomic replacement, and ensure write mode (0o600) is restored before unlinking in the finally block if replacement fails.On Windows, unlinking a read-only staged file or cleaning up on
os.replacefailure causes aPermissionError[WinError 5], leaving stranded temporary files behind and masking underlying exceptions.Changes
tools/world_index.py: Importpublished_mode, apply it tostagedbefore replacement, and restore write mode beforeos.unlinkinfinally:.tests/test_world_index.py: Addtest_staged_entity_report_restores_write_mode_on_replace_failureasserting write mode restoration on replace failure.agent: yes
AI-assisted: yes
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.