Keep private cache fixture source bytes consistent on Windows

Write explicit LF for filesystem source so checked-hash ZIP inputs match the same fixture bytes on every platform. Preserve all cache validity and foreign-format rejection assertions.

Assisted-by: OpenAI Codex:model identifier unavailable
This commit is contained in:
dot committed 2026-10-12 21:35:32 +09:00
1 parent 2191a9d0c8
commit 1f1fe045bb
1 file changed
+2 -2
@@ -18,7 +18,7 @@ if sys.implementation.name == "rustpython":
with tempfile.TemporaryDirectory() as directory:
root = Path(directory)
source = root / "cache_subject.py"
source.write_text("value = 41\n", encoding="ascii")
source.write_text("value = 41\n", encoding="ascii", newline="\n")
code = compile("value = 42\n", "byte_exact/cache_subject.py", "exec")
stat = source.stat()
headers = [
@@ -100,7 +100,7 @@ if sys.implementation.name == "rustpython":
raise AssertionError("foreign ZIP cache accepted")
# Explicit py_compile writes under -B; all writers must use the private token.
source.write_text("value = 41\n", encoding="ascii")
source.write_text("value = 41\n", encoding="ascii", newline="\n")
explicit = root / "explicit.pyc"
previous = sys.dont_write_bytecode
sys.dont_write_bytecode = True