Repository navigation
navmesh_decode, navmesh_index: a --out that is a folder is a usage error, not a traceback - #2930
Conversation
|
Tested |
|
Code read of AI-assisted review (Claude Code). |
|
Windows 11 validation with synthetic inputs. AI-assisted (Codex). Tested |
|
Tested at the head on Windows 11 / Python 3.13.0: Behaviour with an empty
The guard sits ahead of the scan, so no partial output, and the existing One merge note: #2684 conflicts with this only in AI-assisted review, no game files, no GPU. |
17e7a6a to
f5a6633
Compare
Both tools validate --out and --csv against the input (they must not overwrite
it) but never against the filesystem object itself, so pointing --out at an
existing directory opened it for writing and ended the run in a
PermissionError traceback after the scan was already done:
Traceback (most recent call last):
...
PermissionError: [Errno 13] Permission denied: '../reports'
Refuse it up front with the flag name, like the neighbouring checks do, so it
costs one line and the scan never starts.
🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
f5a6633 to
3e105eb
Compare
|
Rebased onto |
|
Independent review of current head |
|
Tested
AI-assisted review. |
What and why
navmesh_decode.pyandnavmesh_index.pycheck that--out/--csvdo not overwrite the input or another report, but never check the object they point at. An existing folder was therefore opened for writing after the scan had already run, and the run ended in a traceback:Both now refuse it up front, next to the neighbouring checks, with the flag name:
Exit code is argparse's 2 for a usage error, the scan never starts, and no partial report is left behind.
Tested
Overlay of this PR's four files on
origin/mainec8ec4c9, Windows, CPU only, Python 3.12:python -IB tests/test_navmesh_decode.py→ 14 tests, OK.python -IB tests/test_navmesh_index.py→ 22 tests, OK.OutputPathTest.test_out_that_is_a_directory_is_refused, i.e. the new test pins the guard and nothing else moves.error:line and exit 2, with noTraceback.Synthetic archives and empty folders only; no game data.
Checklist
docs/design.md, with how it was confirmed. (No translator changes.)