Skip to content

bvh_slot_check: reconfigure stdout with errors='replace' in __main__ - #6508

Closed
BBareth wants to merge 1 commit into
ProjectLeonida:mainfrom
BBareth:fix/bvh-slot-check-stdout-encoding
Closed

BBareth wants to merge 1 commit into
ProjectLeonida:mainfrom
BBareth:fix/bvh-slot-check-stdout-encoding

Conversation

@BBareth

@BBareth BBareth commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Adds the standard sys.stdout.reconfigure(errors="replace") guard in tools/bvh_slot_check.py's __main__ block, fixing tests/test_tool_stdout_encoding.py on main.

Testing

  • python3.12 -m compileall -q tools/bvh_slot_check.py
  • python3.12 -I tests/test_tool_stdout_encoding.py -v (4/4 passed)

AI-assisted (Gemini 4 Hydrogen Medium).

@aarushkha

Copy link
Copy Markdown

Tested 5bd57a7 merged onto main 86a7807dd on Windows 10 Pro 22H2 (19045), Python 3.14.3: pass (its part).

  • python -I tests/test_tool_stdout_encoding.py: Ran 4 tests in 2.731s only the other PRs' entries left

Fixes its entry (tools/bvh_slot_check.py); the other names test_tool_stdout_encoding lists on main are covered by #7152, #7174 and #7032, and with all four applied the test passes.

It merges cleanly together with #7092 #6049 #7120 #6513 #7242 #7209 #6254 #7214 #6957 #7309 #4771 #7029 #7094 #7129 #7152 #7174 #7032 onto main; with all of them applied, the only standalone test still red on Windows is test_first_look_paths (claimed by Racurs156). Summary in #7333.

No GPU or game files needed. AI-assisted (Claude Code); I read the diff before running it.

@Daazd

Daazd commented Nov 23, 2026

Copy link
Copy Markdown

Independent check (Linux, Python 3.12.3, Node 24.13, CPU only, no game files): head 5bd57a76f merged onto main 6a4299563: merges clean.

  • python3 -I tests/test_tool_stdout_encoding.py: Ran 4 tests in 0.164s FAILED (failures=1) (exit 1)

Clears bvh_slot_check in test_tool_stdout_encoding. With #7032, #7152, #7174 and #7650 also merged, the whole test passes.

AI-assisted (Claude Code).

@rojasruiz

Copy link
Copy Markdown

Tested 5bd57a7 merged onto main 5cf3daf on Linux 7.2.15, CPython 3.14. The change is right for tools/bvh_slot_check.py: the file drops out of the test's list. But tests/test_tool_stdout_encoding.py still fails on this branch merged with current main. On main the test lists eight programs without the guard. This PR fixes one; the other seven are still listed: tools/awc_cue_labels.py, tools/import_call_sites.py, tools/op_reach.py, tools/wave_diff.py, tools/world_drawable_lookup.py, tools/world_drawable_verify.py and scripts/dev.py.

Overlap: #7589 adds the same guard to bvh_slot_check.py and to all seven of those (plus a few more files), and #7174 covers op_reach.py, wave_diff.py and scripts/dev.py. Whichever of these lands first will conflict with the others on bvh_slot_check.py.

tests/semantic (443 files / 5,889 tests): identical to main. check_no_game_data.py: clean.

AI-assisted (Claude Code).

@IQ-SAVAGE

Copy link
Copy Markdown

Tested 5bd57a7, CPU only (Linux, Python 3.13, no GPU, no game files); AI-assisted check.

The reconfigure guard matches the pattern the other tools use and sits inside the 400 characters after if __name__ that tests/test_tool_stdout_encoding.py reads. That test passes on this PR's tree (before: it listed tools/bvh_slot_check.py). test_bvh_slot_check.py still shows the 3 unpack errors, which #6513 fixes; the two PRs are independent and both are needed.

@o-psi o-psi left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recommend closing #6508 (5bd57a7) as superseded by #7589 at ed4ed9f, retaining its guard there. Independently compared both complete merge-base diffs: #6508 adds only four lines, and its patch, resulting file, and file mode are identical in #7589. Actual forward/reverse applications and base controls passed; no unique source tests/docs or declared dependency were found. #7176 also contains the guard but has separate tuple-unpack work, while #7589 has separate newline/workflow work; preserve those distinct contributions when reconciling the broader PRs. Both source and replacement are still open at these heads. Linux CPU-only comparison; no game files or unrelated suites. AI-assisted QA (Codex via T3).

@Pierrot1398

Copy link
Copy Markdown

Tested 5bd57a7 on Windows 11 Pro (26300), Python 3.15.2, CPU only: pass.

On main 5d74c27, tests/test_tool_stdout_encoding.py lists 12 programs. With this PR merged together with #7174, #7650, #8629, #7152, #9070 and #7032 (no conflicts), the test passes. I didn't measure each PR alone.

AI-assisted (Claude Code).

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