]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-117716: Fix wave RIFF padding for data chunks (GH-145237)
authorMichiel W. Beijen <mb@x14.nl>
Wed, 15 Apr 2026 12:21:43 +0000 (14:21 +0200)
committerGitHub <noreply@github.com>
Wed, 15 Apr 2026 12:21:43 +0000 (14:21 +0200)
commitca064d9b9999657332d8c73b7b4079ce4311ccec
tree6a129fb82d3494b26cea2c73294c3ba686852f5d
parent69e0a78e6edc3166c7a5b166955c0cefd1bacd5d
gh-117716: Fix wave RIFF padding for data chunks (GH-145237)

wave.Wave_write now writes the required RIFF pad byte when the data chunk
size is odd.

Update RIFF chunk size calculations in both header writing and header
patching so they include the alignment pad byte when present.

Add a regression test in test_wave.py that verifies
odd-sized writes are padded, RIFF size is correct, and roundtrip reads
preserve frame data.
Lib/test/test_wave.py
Lib/wave.py
Misc/NEWS.d/next/Library/2026-02-25-22-20-00.gh-issue-117716.w6kYp9.rst [new file with mode: 0644]