Repository navigation
Conversation
|
Tested AI-assisted (Devi |
|
Tested e10f890 merged with main 3faac55 on Linux (WSL2) Python 3.12.16 (-I): pass tests/test_world_interior_names.py: 12 run / 12 passed / 0 failed. By hand on the CLI (empty folder as the scan path): --names as a JSON array, a malformed file, a non-UTF-8 file and Negative control: with tools/world_interior_names.py from main the test file gives 7 errors of 12; with the PR file all pass. Not run natively on Windows (Linux only here); the PR already has a Windows check on this head. |
|
Verified on Linux: merges cleanly with current main 3faac55, and tests/test_world_interior_names.py passes 12 tests under python -I (re-run), including the new exit-2 checks for unreadable --names (directory, bad UTF-8, malformed/non-object JSON) and unwritable --out, each asserting a single ERROR line and no traceback. UnicodeDecodeError being a ValueError subclass means the except clause genuinely covers the bad-UTF-8 case, the output write still pins newline with utf-8, and the mocked-scan test proves validation runs before scanning. Nothing on main touched these files since your base. This branch gets no CI runs, so treat this as the CI evidence. AI-assisted: yes. Tested on Linux (RTX 5080 host, CPU-only run). |
|
Tested
|
e10f890 to
4a6c657
Compare
|
Tested
No game files. AI-assisted (Claude Code). |
|
Tested 4a6c657 merged with main 8575d36 on Linux (WSL2) Python 3.12.16 (-I): pass |
Reports invalid/unreadable
--namesinputs and unwritable--outpaths intools/world_interior_names.pyas single-line stderr errors with exit code2instead of unhandled tracebacks.Changes
load_names()validates that the parsed JSON root andInteriorNamessection are JSON objects (ValueErrorotherwise instead ofAttributeError).main()checksos.path.isdir(a.names)and loadsa.namesinsidetry ... except (OSError, ValueError)before scanning, exiting2withERROR: cannot read ...on a directory, unreadable file, invalid UTF-8, malformed JSON, or non-object JSON.main()checksos.path.isdir(a.out)before scanning and wrapsos.makedirs+open(a.out, "w", encoding="utf-8", newline="\n")+json.dumpintry ... except OSError, exiting2withERROR: cannot write ...instead of a traceback.tests/test_world_interior_names.py(test_bad_names_file_is_one_error_line_before_scanning,test_unwritable_out_is_one_error_line).--outoverwriting input files) and world_interior_names: reject the arguments the run cannot honour #4690 (which validates--jobsand window arguments).Claim
Claimed in #4683: #4683 (comment)
Testing
python -I tests/test_world_interior_names.py -v: 12/12 OK.python -I tests/test_text_write_line_endings.py: 3/3 OK.python -m compileall -q tools/world_interior_names.py tests/test_world_interior_names.py&git diff --check: clean.AI-assisted (Gemini 4 Neon).