mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:50:52 +01:00
[PR #1088] [MERGED] recomp_census: a wrong input is one ERROR line, not a traceback (RECOMP-CENSUS-WRONG-INPUT) #1123
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#1123
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/1088
Author: @tiguan26
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/24/2026
Merged by: @QemmHD
Base:
main← Head:fix/recomp-census-wrong-input📝 Commits (1)
4243713recomp_census: a wrong input is one ERROR line, not a traceback (RECOMP-CENSUS-WRONG-INPUT)📊 Changes
2 files changed (+71 additions, -7 deletions)
View changed files
📝
tests/test_recomp_census.py(+56 -0)📝
tools/recomp_census.py(+15 -7)📄 Description
Claimed in the coordination issue as: RECOMP-CENSUS-WRONG-INPUT (claim, done)
What and why
tools/recomp_census.pystopped with a traceback on a wrong input:FileNotFoundError),IsADirectoryError),--outnaming an existing file (FileExistsErrorfromos.makedirs).Each now prints one
ERROR: ...line and exits 2, liketools/navmesh_nodes.pyand the three tools in #952 (which does not touch this one). A PE that is not x86-64 or has no MZ header keeps its current message and exit code 1.The module docstring said the tool writes
<out>/<file>.jsonand<out>/<file>.md; it writes<file>.recomp.jsonand<file>.recomp.md, so that line is corrected.Tested
On Linux (Python 3.13.18), from the checkout root on
main3aa9754:python -I tests/test_recomp_census.py: 11 tests pass. The four new ones (WrongInputTests) use the byte-built PE fixture already in the file; the three wrong-input cases fail against the tool onmainand pass with the fix, and the fourth checks a good image still writes both reports.tests/test_tool_startup.py,tests/test_text_write_line_endings.py,tests/test_tool_stdout_encoding.py,tests/test_docs_links.py: pass.python -m compileall -q tools tests,python -I scripts/check_no_game_data.pyon both files,git diff --check: clean.Not run on real game files; the normal output is unchanged.
GPUs tested: n/a (no GPU code changed)
AI-assisted: yes (Claude)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: no translator change)🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.