Skip to content

tools: pin text writes to newline="\n" in leonida_tui and wave_diff - #7857

Open
dentedlmfao wants to merge 1 commit into
ItsNotRexed:mainfrom
dentedlmfao:fix/text-write-newlines
Open

dentedlmfao wants to merge 1 commit into
ItsNotRexed:mainfrom
dentedlmfao:fix/text-write-newlines

Conversation

@dentedlmfao

Copy link
Copy Markdown

Fixes a regression where tests/test_text_write_line_endings.py failed on main because tools/leonida_tui.py and tools/wave_diff.py opened text files without specifying newline="\n".

  • tools/leonida_tui.py: added newline="\n" to StageConsole.__init__.
  • tools/wave_diff.py: added newline="\n" to _write().

AI-assisted. Tested with python3 -I tests/test_text_write_line_endings.py, python3 -I tests/test_leonida_tui.py, and python3 -I tests/test_wave_diff.py on macOS (Apple Silicon, CPU-only standard library tests). No game data.

@skorex

skorex commented Nov 23, 2026

Copy link
Copy Markdown

Duplicate of #7819

#7819 makes the same change and was opened earlier. Topic: leonida_tui, wave_diff: pin newline="\n" on their text writers.

Suggest closing this PR in favour of #7819, and porting anything this one adds that #7819 lacks there.

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

Both write sites now disable Python’s platform newline translation while preserving UTF-8/error handling and the existing line content. Ran python -I tests/test_text_write_line_endings.py on this PR head: 3 tests passed.

@ne1i

ne1i commented Nov 23, 2026

Copy link
Copy Markdown

Tested 984595dd on Linux, CPython 3.14, CPU only, synthetic inputs, merged onto main dde82f27: pass

  • python -I tests/test_text_write_line_endings.py: 3 tests OK (red on main: 1 failure).
  • With only the two tools reverted to main: 1 failure again.
  • compileall (where the change has Python files) and scripts/check_no_game_data.py on the changed files: clean.

#7819 makes the same two changes, also turns the file green, and adds a byte-level regression test; the two edit the same lines, so only one can land as is.

Independent check (not the author). Run by an AI agent (DeepSeek V4.1 Flash) and re-run by the orchestrating session (Claude Code) before posting; claimed in #8047.

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