[PR #906] NAVMESH-TILE-STAGE-CLEANUP: harden staged OBJ output and cleanup #943

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

📋 Pull Request Information

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

Base: main ← Head: navmesh-tile-stage-cleanup


📝 Commits (1)

  • d4019e4 navmesh_tile_obj: harden staged output cleanup (NAVMESH-TILE-STAGE-CLEANUP)

📊 Changes

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

View changed files

➕ tests/test_navmesh_tile_stage_cleanup.py (+43 -0)
📝 tools/navmesh_tile_obj.py (+11 -1)

📄 Description

Claimed in the coordination issue as: NAVMESH-TILE-STAGE-CLEANUP (claim comment).

tools/navmesh_tile_obj.py wrote its staged OBJ with NamedTemporaryFile's mode and, on a failed os.replace, deleted the staged file in finally without making it writable first. On Windows a staged file carrying a read-only destination's mode cannot be unlinked, so the cleanup error masks the real ERROR: line. This publishes the staged file with published_mode(out) and, on failure, chmods it to 0o600 before unlinking, with both cleanup failures suppressed so the original error survives.

New tests/test_navmesh_tile_stage_cleanup.py patches os.replace to fail and asserts the staged file is made writable, removed, and the previous output is left intact. Verified red on origin/main and green with this change.

No game data: synthetic navmesh archive only. python3 -I scripts/check_no_game_data.py passes; line-ending test passes.

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/906 **Author:** [@fitzypopper](https://github.com/fitzypopper) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `navmesh-tile-stage-cleanup` --- ### 📝 Commits (1) - [`d4019e4`](https://github.com/ubiquitarianism/leonida/commit/d4019e4e498c30a961ef04ecd1cd8eafbd75af45) navmesh_tile_obj: harden staged output cleanup (NAVMESH-TILE-STAGE-CLEANUP) ### 📊 Changes **2 files changed** (+54 additions, -1 deletions) <details> <summary>View changed files</summary> ➕ `tests/test_navmesh_tile_stage_cleanup.py` (+43 -0) 📝 `tools/navmesh_tile_obj.py` (+11 -1) </details> ### 📄 Description Claimed in the coordination issue as: `NAVMESH-TILE-STAGE-CLEANUP` ([claim comment](https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7135525133)). `tools/navmesh_tile_obj.py` wrote its staged OBJ with `NamedTemporaryFile`'s mode and, on a failed `os.replace`, deleted the staged file in `finally` without making it writable first. On Windows a staged file carrying a read-only destination's mode cannot be unlinked, so the cleanup error masks the real `ERROR:` line. This publishes the staged file with `published_mode(out)` and, on failure, chmods it to `0o600` before unlinking, with both cleanup failures suppressed so the original error survives. New `tests/test_navmesh_tile_stage_cleanup.py` patches `os.replace` to fail and asserts the staged file is made writable, removed, and the previous output is left intact. Verified red on `origin/main` and green with this change. No game data: synthetic navmesh archive only. `python3 -I scripts/check_no_game_data.py` passes; line-ending test passes. 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#943
No description provided.