hashdict: report unreadable --extra files cleanly (HASHDICT-EXTRA-READ-ERROR) #1071
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs rebase
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ubiquitarianism--leonida!1071
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1071/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@j-weiner on GitHub · 2026-11-24 17:46 UTC · original
j-weiner:fix/hashdict-extra-read-error→main· +31 −2 · 2 files · 1 commits · merged 2026-11-24 23:21 UTCClaimed in the coordination issue as: HASHDICT-EXTRA-READ-ERROR (#14)
What and why
When
hashdict.pyreads a regular file supplied through--extra, anOSErrorfrom opening or reading it escaped as a traceback. The tool already reports unreadable extra directories cleanly. This catches the file case, prints oneERRORline, exits 2, and leaves an existing--outunchanged. The regression uses a syntheticPermissionError; no game files are needed.Tested
python -I -B tests/test_hashdict.py— 42 passed, 1 skipped.python -I -B tests/test_tool_startup.py— 2 passed.python -I -B tests/test_text_write_line_endings.py— 3 passed.python -m compileall -q tools/hashdict.py tests/test_hashdict.py— passed.python -I scripts/check_no_game_data.py tools/hashdict.py tests/test_hashdict.py— passed.python -I tools/hashdict.py --help— passed.git diff --check— passed.PermissionErrorbefore the fix; it now verifies the one-line diagnostic, exit code 2, and preserved output.GPUs tested: n/a (CPU-only synthetic tests).
AI-assisted: yes.
Checklist
mainand merges cleanly.@KernelSmoker on GitHub · 2026-11-24 18:03 UTC · original · approved these changes
The synthetic regression exercises the unreadable regular-file path, checks the one-line diagnostic and exit code 2, and confirms the existing output dictionary is preserved. The catch is limited to opening/reading the --extra file and returns before output serialization. On exact head
4c1eae0055, independent checks passed: hashdict 43/43, tool startup 2/2, line endings 3/3; --help, no-game-data, diff, and merge-tree checks also passed. CPU-only synthetic tests; no game data.@QemmHD on GitHub · 2026-11-24 23:21 UTC · original
Merging.
Why merged: HASHDICT-EXTRA-READ-ERROR: an unreadable --extra file gives one ERROR line and exit 2, and an existing --out file is left intact instead of being clobbered. KernelSmoker approved it.
Why it's good: test_hashdict: 42 passed, 1 skipped.
Tested on Windows 11 / RTX 4070 SUPER: merged alone onto main
0f98d193c. With it in, the repo-consistency set (cmake/translator-deps, shader_stage_resume, runtime_paths, docs, make_game, no-game-data, run_semantic_tests, ctest_registration) gives 578 passed / 5 skipped / 0 failed, and check_no_game_data on the changed files is clean. git merge-tree against current main: no conflicts. Security read of the three-dot diff: no binaries, game data, downloads, network calls or CI changes.AI-assisted (Claude Code, Claude Opus 5.5).