mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:45:53 +01:00
[PR #1769] navmesh_index: report missing input before mode checks, handle write OSError, separate cleanup guards, and align pattern matching (NAVMESH-INDEX-ERROR-HANDLING-AND-CLEANUP) #1781
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#1781
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/1769
Author: @kirigayakazima
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:fix/navmesh-index-error-handling-and-cleanup📝 Commits (1)
6de3ecbnavmesh_index: report missing input before mode checks, handle write OSError, separate chmod/unlink cleanup, and align pattern matching📊 Changes
2 files changed (+112 additions, -19 deletions)
View changed files
📝
tests/test_navmesh_index.py(+81 -0)📝
tools/navmesh_index.py(+31 -19)📄 Description
Claimed in the coordination issue as: NAVMESH-INDEX-ERROR-HANDLING-AND-CLEANUP https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7161419600
What and why
Fixes four bugs in
tools/navmesh_index.py(plus drops the duplicatesys.path.insert):os.path.exists(a.input)before archive/directory mode checks: Nonexistent paths with--patternpreviously fell intonot is_dirand exited with--pattern applies to a directory, not an archiveinstead ofERROR: <path>: does not exist. (--out/--csvequality andisdirchecks remain first, preservingtest_explicit_output_collision_before_scan.)write_outputsOSErrorcleanly: Wrapwrite_outputs(...)intry/except OSErrorprinting oneERROR: cannot write ...line and returning exit2without a Python traceback (keepingwrite_outputs's ownOSErrorcontract intact for unit callers).os.chmod(temp, 0o600)andos.unlink(temp)cleanup guards in_publish: Use two separatewith suppress(OSError):blocks so a failingchmodduring exception cleanup does not skip unlinkingtemp.is_scanned_inputpattern matching withscan_directory: Share_pattern_query(normalizingaltsepand prepending**only once) betweenscan_directoryandis_scanned_input, and normalizealtsep/ leading**/inis_scanned_input'sfnmatchbranch.Adds 4 regression tests in
tests/test_navmesh_index.py.Tested
Windows 11 x64 (
10.0.26100), Python3.14.7, CPU only, synthetic0DRP/RPF9 fixtures only (no game files). Commit6de3ecb759c9bc180d2422aa646b283d86f677a2.python -I tests/test_navmesh_index.py -v:main(bcaa13da) with all 38 tests: 4 failures, 1 skipped (existing POSIX permission test);test_replaced_report_keeps_its_permission_bitsskipped on Windows).python -I tests/test_ci_registration.py: 16 tests, OK.python -I tests/test_text_write_line_endings.py: 3 tests, OK.python -I scripts/check_no_game_data.py tools/navmesh_index.py tests/test_navmesh_index.py,python -m compileall -q tools tests,git diff --check: exit0.GPUs tested: n/a
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: no translator change)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.