From 1f1fe045bb3067dcebd2f2a3a4e6fc1e84ed585e Mon Sep 17 00:00:00 2001 From: dot Date: Mon, 12 Oct 2026 21:35:32 +0900 Subject: [PATCH] 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 --- extra_tests/snippets/private_315_cache_contract.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extra_tests/snippets/private_315_cache_contract.py b/extra_tests/snippets/private_315_cache_contract.py index 558fe124f..0f0bdfe88 100644 --- a/extra_tests/snippets/private_315_cache_contract.py +++ b/extra_tests/snippets/private_315_cache_contract.py @@ -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