[PR #1939] [CLOSED] setup: write run-<model>.bat and the build .bat with single CRLF line ends #3767

Closed
opened 2026-11-07 15:30:36 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/1939
Author: @markusrenneronline
Created: 10/11/2026
Status: ❌ Closed

Base: main ← Head: fix/setup-bat-crlf


📝 Commits (1)

  • 87c2fd9 setup: write run-.bat and the build .bat with single CRLF line ends (text mode doubled the CR)

📊 Changes

2 files changed (+35 additions, -2 deletions)

View changed files

📝 setup.py (+3 -2)
➕ tools/test_setup_run_script_newlines.py (+32 -0)

📄 Description

write_run_script() and the Windows build step write their .bat files with explicit \r\n, but through Path.write_text() in text mode. On Windows text mode translates every \n again, so the files end up with \r\r\n (seen in a freshly written run-coder-iq1_m.bat: @echo off\r\r\n). cmd tolerates it, so nothing breaks today, but the files are not what the code intends.

  • setup.py: newline="" in both write_text() calls (run script, build .bat), so the \r\n are written as is.
  • tools/test_setup_run_script_newlines.py: writes the run script with WIN patched into a temp folder and checks for single CRLF line ends. On Windows it fails without the fix and passes with it.

No other behavior changes. (Two serve tests also write \r\n through write_text; left as they are, they only create helper scripts.)


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/1939 **Author:** [@markusrenneronline](https://github.com/markusrenneronline) **Created:** 10/11/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/setup-bat-crlf` --- ### 📝 Commits (1) - [`87c2fd9`](https://github.com/Niko1221/Strata/commit/87c2fd94323ec41a92f380d1c55e6adce6be8d25) setup: write run-<model>.bat and the build .bat with single CRLF line ends (text mode doubled the CR) ### 📊 Changes **2 files changed** (+35 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `setup.py` (+3 -2) ➕ `tools/test_setup_run_script_newlines.py` (+32 -0) </details> ### 📄 Description `write_run_script()` and the Windows build step write their `.bat` files with explicit `\r\n`, but through `Path.write_text()` in text mode. On Windows text mode translates every `\n` again, so the files end up with `\r\r\n` (seen in a freshly written `run-coder-iq1_m.bat`: `@echo off\r\r\n`). `cmd` tolerates it, so nothing breaks today, but the files are not what the code intends. - `setup.py`: `newline=""` in both `write_text()` calls (run script, build `.bat`), so the `\r\n` are written as is. - `tools/test_setup_run_script_newlines.py`: writes the run script with `WIN` patched into a temp folder and checks for single CRLF line ends. On Windows it fails without the fix and passes with it. No other behavior changes. (Two serve tests also write `\r\n` through `write_text`; left as they are, they only create helper scripts.) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 15:30:36 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#3767
No description provided.