fix(quick-dev): preserve source line endings in render.py
Python text-mode open() with the platform default performs universal- newline translation: on Windows, LF source files get written as CRLF, producing spurious diffs when rendered output is compared against source. Pass newline="" on both the source read and the rendered write so line endings pass through verbatim. Part of plan-quick-dev-python-config-hardening.md (F4). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
ea0c12ac04
commit
6f849e00a3
|
|
@ -137,9 +137,9 @@ def main():
|
|||
continue
|
||||
src = posixpath.join(script_dir, fname)
|
||||
dst = posixpath.join(out_dir, fname)
|
||||
with open(src, "r", encoding="utf-8") as fh:
|
||||
with open(src, "r", encoding="utf-8", newline="") as fh:
|
||||
content = fh.read()
|
||||
with open(dst, "w", encoding="utf-8") as fh:
|
||||
with open(dst, "w", encoding="utf-8", newline="") as fh:
|
||||
fh.write(render_template(content, vars_))
|
||||
count += 1
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue