Skip to content

require padding when decoding base64 on Python 3.15+#428

Open
mgorny wants to merge 1 commit into
pallets:mainfrom
mgorny:py315-base64
Open

require padding when decoding base64 on Python 3.15+#428
mgorny wants to merge 1 commit into
pallets:mainfrom
mgorny:py315-base64

Conversation

@mgorny

@mgorny mgorny commented Jul 3, 2026

Copy link
Copy Markdown

Restore the old behavior of urlsafe_b64decode() to require padding when running on Python 3.15+, in order to fix raising BadData in some cases of malformed input. This fixes the test failures in "bad payload" tests that incidentally surface when using zlib-ng as the compression library.

Fixes #420

Restore the old behavior of `urlsafe_b64decode()` to require padding
when running on Python 3.15+, in order to fix raising `BadData` in some
cases of malformed input.  This fixes the test failures in "bad payload"
tests that incidentally surface when using zlib-ng as the compression
library.

Fixes pallets#420

Signed-off-by: Michał Górny <mgorny@gentoo.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Test failures with Python 3.15.0b1: test_bad_payload_exception[zlib] and test_loads_unsafe[zlib]

1 participant