Skip to content

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

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

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

Conversation

@trigger337

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

@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.

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.

4 participants