]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] gh-145264: Do not ignore excess Base64 data after the first padded quad (GH...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 23 Mar 2026 23:52:20 +0000 (00:52 +0100)
committerGitHub <noreply@github.com>
Mon, 23 Mar 2026 23:52:20 +0000 (00:52 +0100)
commit1f9958f909c1b41a4ffc0b613ef8ec8fa5e7c474
tree9cac5bafd9130165785086fa4d086cd13ad9eac5
parenteda53e6cf1c518704d870dd77c35f0cca9c71c52
[3.13] gh-145264: Do not ignore excess Base64 data after the first padded quad (GH-145267) (GH-146326) (GH-146348)

Base64 decoder (see binascii.a2b_base64(), base64.b64decode(), etc)
no longer ignores excess data after the first padded quad in non-strict
(default) mode.  Instead, in conformance with RFC 4648, it ignores the
pad character, "=", if it is present before the end of the encoded data.
(cherry picked from commit 4561f6418a691b3e89aef0901f53fe0dfb7f7c0e)
(cherry picked from commit e31c55121620189a0d1a07b689762d8ca9c1b7fa)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Lib/test/test_binascii.py
Misc/NEWS.d/next/Library/2026-02-26-20-13-16.gh-issue-145264.4pggX_.rst [new file with mode: 0644]
Modules/binascii.c