Skip to content

navmesh_links: stage --out so a write failure keeps the previous report - #8865

Open
Grimkeh wants to merge 1 commit into
ItsNotRexed:mainfrom
Grimkeh:fix/navmesh-links-preserve-json
Open

Grimkeh wants to merge 1 commit into
ItsNotRexed:mainfrom
Grimkeh:fix/navmesh-links-preserve-json

Conversation

@Grimkeh

@Grimkeh Grimkeh commented Nov 23, 2026

Copy link
Copy Markdown

Summary

Claim: #8504 (comment)

Synthetic; no game files. AI-assisted (Cursor / Composer).

Test plan

  • python3 -I -m unittest discover -s tests -p test_navmesh_links.py — 9 OK

Made with Cursor

Publish through a temp file + replace so a mid-write OSError leaves any prior complete JSON intact.

Co-authored-by: Cursor <cursoragent@cursor.com>
@catminou4

Copy link
Copy Markdown

Tested on Apple M1 Max, macOS 27.2.1 arm64, Python 3.12.16: python -I tests/test_navmesh_links.py → 9 tests OK. No game files. AI-assisted (Devin).

@shyro29 shyro29 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on Linux x86_64, CPython 3.14 (no game files): pass.

  • python -I tests/test_navmesh_links.py: OK at the head; FAILED (errors=1) with the same test file against main's tool — red/green confirmed.
  • The dual-import structure is right for this tool's two import modes (from tools.… when imported as a package, sibling sys.path.insert when run directly), and both branches now resolve published_mode/replace_retry; the writer's bytes are unchanged (indent=2 + trailing newline).
  • Staging follows the merged #2684 template: destination touched only by os.replace, published_mode bits, replace_retry, finally unlink; the read-only-destination PermissionError probe is retained, and non-regular destinations still write directly.
  • python -I scripts/check_no_game_data.py on the two changed files: clean. AI-assisted (Claude Code).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants