[PR #834] world_names: restore write mode before unlink on replace failure and publish mode (WORLD-NAMES-STAGE-CLEANUP) #870

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

📋 Pull Request Information

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

Base: main ← Head: fix/world-names-stage-cleanup


📝 Commits (1)

  • 2cb6ed8 world_names: restore write mode before unlink on replace failure and publish mode (WORLD-NAMES-STAGE-CLEANUP)

📊 Changes

2 files changed (+23 additions, -1 deletions)

View changed files

📝 tests/test_world_names.py (+16 -0)
📝 tools/world_names.py (+7 -1)

📄 Description

When writing dictionary JSON atomically in _write_json, apply published_mode to the staged file and reset os.chmod to 0o600 before exiting TemporaryDirectory if os.replace fails, ensuring cleanup does not fail with PermissionError on Windows when replacing a read-only file.

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/834 **Author:** [@trigger337](https://github.com/trigger337) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/world-names-stage-cleanup` --- ### 📝 Commits (1) - [`2cb6ed8`](https://github.com/ubiquitarianism/leonida/commit/2cb6ed88211623460ceab5b3d9cf819d1816fb26) world_names: restore write mode before unlink on replace failure and publish mode (WORLD-NAMES-STAGE-CLEANUP) ### 📊 Changes **2 files changed** (+23 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `tests/test_world_names.py` (+16 -0) 📝 `tools/world_names.py` (+7 -1) </details> ### 📄 Description When writing dictionary JSON atomically in _write_json, apply published_mode to the staged file and reset os.chmod to 0o600 before exiting TemporaryDirectory if os.replace fails, ensuring cleanup does not fail with PermissionError on Windows when replacing a read-only file. 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#870
No description provided.