Repository navigation
dstorage_census: a wrong input is one ERROR line, not a traceback (DSTORAGE-CENSUS-WRONG-INPUT) - #1500
Merged
MoonEyes merged 1 commit intoNov 28, 2026
Conversation
…TORAGE-CENSUS-WRONG-INPUT) A trace path that does not exist (FileNotFoundError), a folder for the trace (IsADirectoryError) and a ds-request line with a missing field (KeyError) or a malformed number (ValueError) stopped the tool with a traceback. Each now prints one ERROR line and exits 2, like tools/recomp_census.py. census() wraps the unchanged loop and names the line and the field; main() is split out so it can be tested. Synthetic traces only; no game files.
Contributor
|
[KEEP]
|
tiguan26
approved these changes
Nov 25, 2026
tiguan26
left a comment
Contributor
There was a problem hiding this comment.
Approving. Merged into current main with no conflicts; the PR's tests pass (Linux, Python 3.13). Same shape as the other wrong-input fixes (#1088, #952): an unreadable trace or a ds-request line with a missing or malformed field is one ERROR line with the line number and exit 2, and a good trace prints the same JSON as before.
AI-assisted (Claude).
Collaborator
|
Red/green: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Claimed in the coordination issue as: DSTORAGE-CENSUS-WRONG-INPUT (claim)
Depends on: none
Fixes: none
What and why
tools/dstorage_census.pystopped with a Python traceback on a wrong input:FileNotFoundError) or is a folder (IsADirectoryError);[rt] ds-requestline with a missing field (KeyError: 'dest') or a malformed number (ValueErrorfromint(..., 16)), for example a trace cut off mid-line.Each is now one
ERROR:line on stderr and exit code 2, likerecomp_census(#1088). The census loop is unchanged:census()wraps it and turns aKeyError/ValueErrorinto aTraceErrorthat names the line number and the field.main()is split out of the__main__block so it can be tested; output and exit code 0 for a good trace are unchanged.Found by running every
tools/*.pyagainst a missing path, an empty file, a junk file and a folder. The other tools that traceback in that sweep (gbuffer_census,navmesh_cell_fit,root_spill_census) are covered by #952, so they are left alone.Tested
python -I tests/test_dstorage_census.py: 7 tests OK (new file: a good trace, missing field, malformed number, missing path, folder, truncated line, exit 0 on a good trace). With the old tool the same file fails 5 of 7.python -m compileall -q tools tests,tests/test_text_write_line_endings.py,tests/test_docs_cli_flags.py,tests/test_docs_links.py,tests/test_tool_stdout_encoding.py: OK.scripts/check_no_game_data.pyon both files: clean. Traces in the test are built by hand; no game files, no GPU.GPUs tested: n/a (CPU-only tool and test)
AI-assisted: yes