Skip to content

tools, workflows: reconfigure stdout error handling and pin text write newlines - #7589

Closed
trigger337 wants to merge 1 commit into
ProjectLeonida:mainfrom
trigger337:fix/tool-hygiene-and-workflow-paths
Closed

trigger337 wants to merge 1 commit into
ProjectLeonida:mainfrom
trigger337:fix/tool-hygiene-and-workflow-paths

Conversation

@trigger337

@trigger337 trigger337 commented Nov 23, 2026 •

Copy link
Copy Markdown

Summary

Fixes static test suite failures in tests/test_tool_stdout_encoding.py, tests/test_text_write_line_endings.py, and tests/test_runtime_paths.py:

  • Stdout Encoding Guard: Added sys.stdout.reconfigure(errors="replace") inside if __name__ == "__main__": blocks for 10 CLI tools/scripts (tools/awc_cue_labels.py, tools/bvh_slot_check.py, tools/gbuffer_census.py, tools/import_call_sites.py, tools/navmesh_tile_obj.py, tools/op_reach.py, tools/wave_diff.py, tools/world_drawable_lookup.py, tools/world_drawable_verify.py, scripts/dev.py).
  • Newline Pinning: Added newline="\n" to text writes in tools/leonida_tui.py and tools/wave_diff.py.
  • Workflow Trigger Paths: Added tools/replace_retry.py to push: and pull_request: path filters in .github/workflows/runtime.yml as required by test_runtime_paths.py.

Validation

python3 -m unittest tests/test_tool_stdout_encoding.py tests/test_text_write_line_endings.py tests/test_runtime_paths.py
# Ran 12 tests in 3.783s - OK

AI-assisted: yes

@morodirule

Copy link
Copy Markdown

Tested ed4ed9f on Arch Linux, Python 3.14.10, CPU only: pass — test_text_write_line_endings 3/3 OK; compileall clean on all 11 changed Python files; related suites (awc_cue, gbuffer, import_call_sites, leonida_tui, navmesh_tile, op_reach, wave_diff, world_drawable_lookup/verify) all OK. Negative control: wave_diff.py swapped to parent → line-endings fails 1/3 (missing newline=); restored, green. One pre-existing failure: bvh_slot_check 3 errors (6-tuple unpack drift, identical with parent tool — outside this PR's scope). No game files. AI-assisted.

Daazd pushed a commit to Daazd/Leonida that referenced this pull request Nov 23, 2026
…7589

ItsNotRexed#7589 (opened earlier) already guards stdout in those two tools; this
branch keeps only div_fixup_diff, which ItsNotRexed#7589 does not cover.

Co-Authored-By: Claude <noreply@anthropic.com>
@Daazd

Daazd commented Nov 23, 2026

Copy link
Copy Markdown

Independent check (Linux, Python 3.12.3, CPU only): merged onto main 6a4299563 (clean), test_tool_stdout_encoding still lists tools/div_fixup_diff.py (merged without the guard in #6698). #7650 adds just that file (no files in common with this PR), and with both merged the test passes. This PR also covers every tool in #6508, #7032, #7152 and #7174.

AI-assisted (Claude Code).

@HungLe17

Copy link
Copy Markdown

Tested ed4ed9f6 on Windows 11 build 26200, Python 3.14.5, Ryzen 7 7700: pass. test_tool_stdout_encoding.py (4/4), test_text_write_line_endings.py (3/3), and test_runtime_paths.py (5/5) all passed. In our earlier Windows checks the newline sweep flagged tools/leonida_tui.py and tools/wave_diff.py; the sweep here reported neither. Synthetic inputs only. AI-assisted.

@giusepperainone

Copy link
Copy Markdown

Tested ed4ed9f merged onto main 6dda063, Windows 11, Python 3.12.10, CPU only: tests/test_text_write_line_endings.py and tests/test_runtime_paths.py OK; tests/test_tool_stdout_encoding.py still lists tools/div_fixup_diff.py. Merged together with #7650 (d8183ff) there are no conflicts and test_tool_stdout_encoding passes. No game files.

@KoertLichtendonk

Copy link
Copy Markdown
Contributor

Coordinator note: this looks like the same change as #7176 by @thiefyzheng (opened 16:06 UTC, still open). Please compare the two and either close this one or say here what it adds. The maintainer decides which one is merged.

@rideinstead

Copy link
Copy Markdown

✅ Automated security review: CLEAN (commit ed4ed9f6)

  • No findings.

Scope: static analysis of added diff lines only; no code was executed. Please review findings manually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants