Skip to content

Commit 8cfa2ef

Browse files
committed
Normalize parity stdout line endings before hashing
Windows CPython writes CRLF from the probe subprocesses, which changed the sha256 of otherwise byte-identical PCM output and failed every Windows CI job. The committed oracle hashes are over LF text, so normalize before hashing.
1 parent a79d805 commit 8cfa2ef

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

tests/parity/verify_effects.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
sys.stderr.buffer.write(result.stdout)
2323
sys.stderr.buffer.write(result.stderr)
2424
raise SystemExit(result.returncode)
25-
actual = hashlib.sha256(result.stdout).hexdigest()
25+
actual = hashlib.sha256(result.stdout.replace(b"\r\n", b"\n")).hexdigest()
2626
expected = fixture["cpython_stdout_sha256"]
2727
if actual != expected:
2828
raise SystemExit(

tests/parity/verify_streaming.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
sys.stderr.buffer.write(result.stdout)
2626
sys.stderr.buffer.write(result.stderr)
2727
raise SystemExit(result.returncode)
28-
actual = hashlib.sha256(result.stdout).hexdigest()
28+
actual = hashlib.sha256(
29+
result.stdout.replace(b"\r\n", b"\n")).hexdigest()
2930
expected = fixture[f"{name}_stdout_sha256"]
3031
if actual != expected:
3132
raise SystemExit(

0 commit comments

Comments
 (0)