[PR #836] world_census: restore write mode before temporary directory cleanup in _staged_json (WORLD-CENSUS-STAGE-CLEANUP) #874

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/836
Author: @trigger337
Created: 11/24/2026
Status: 🔄 Open

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


📝 Commits (1)

  • 044d410 world_census: restore write mode before temporary directory cleanup in _staged_json (WORLD-CENSUS-STAGE-CLEANUP)

📊 Changes

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

View changed files

📝 tests/test_world_census.py (+22 -0)
📝 tools/world_census.py (+7 -1)

📄 Description

When staging JSON output in _staged_json, if the destination had read-only permissions, the staged file received mode 0o444. If publishing fails or raises an exception, resetting os.chmod to 0o600 in finally ensures TemporaryDirectory cleanup does not fail with PermissionError on Windows.

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/836 **Author:** [@trigger337](https://github.com/trigger337) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/world-census-stage-cleanup` --- ### 📝 Commits (1) - [`044d410`](https://github.com/ubiquitarianism/leonida/commit/044d410cd3259fe2d2e43d5f7d87abf9ff84f14d) world_census: restore write mode before temporary directory cleanup in _staged_json (WORLD-CENSUS-STAGE-CLEANUP) ### 📊 Changes **2 files changed** (+29 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `tests/test_world_census.py` (+22 -0) 📝 `tools/world_census.py` (+7 -1) </details> ### 📄 Description When staging JSON output in _staged_json, if the destination had read-only permissions, the staged file received mode 0o444. If publishing fails or raises an exception, resetting os.chmod to 0o600 in finally ensures TemporaryDirectory cleanup does not fail with PermissionError on Windows. 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#874
No description provided.