Repository navigation
sandbox_scene: --out that names a folder is refused up front with a clear message - #6204
Conversation
…iled write one error line (finding in the coordination issue, claim 7102450817)
shayderrr
left a comment
There was a problem hiding this comment.
Summary
In tools/sandbox_scene.py main(), calls ap.parse_args(argv) once, then checks os.path.isdir(args.out) immediately and returns ERROR: --out is a folder, not a scene file: <path> (exit 2) before build() reads anything; the existing OSError try block now reuses the parsed args. tests/test_sandbox_scene.py tightens test_out_directory_is_one_error_line to assert the reason text and absence of [Errno.
Why merge
Fails fast with a plain, one-line message instead of building the whole scene and printing a repr'd OSError with doubled Windows backslashes.
Verdict: Approve
SummaryIn Why mergeFails fast with a plain, one-line message instead of building the whole scene and printing a repr'd Verdict: Approve |
Finding + claim in the coordination issue:
tools/sandbox_scene.pyalready caught the--outfolder case as anOSError, but only after the whole scene was built, and the line was the repr'dstr(OSError)with every backslash doubled (the same message shape PR #5927 is fixing elsewhere).The refusal now happens right after
parse_argswith a plain message naming the problem, before any file is read.Tested
python -m pytest tests/test_sandbox_scene.py -q: all pass; the existingtest_out_directory_is_one_error_linenow also asserts the message says why and carries no[Errno ...]repr.Two commits: the tool, then the test. Windows 11, Python 3.12.10, CPU only. No game files. AI-assisted.
Checklist
docs/design.md, with how it was confirmed. (No translator changes.)