Skip to content

AI junk - #427

Closed
ishaanlabs-gg wants to merge 1 commit into
pallets:mainfrom
ishaanlabs-gg:fix-python315-strict-base64
Closed

AI junk#427
ishaanlabs-gg wants to merge 1 commit into
pallets:mainfrom
ishaanlabs-gg:fix-python315-strict-base64

Conversation

@ishaanlabs-gg

Copy link
Copy Markdown

Keep URL-safe base64 decoding strict by using base64.b64decode(..., altchars=b"-_", validate=True) instead of the permissive urlsafe_b64decode() path.

This prevents invalid characters inside a payload segment from being discarded before decoding, which is the behavior behind the Python 3.15/zlib-ng failure reported in #420.

Validation:

  • /Volumes/STOREJET/2/Dependencies/itsdangerous-py314-venv/bin/python -m pytest tests/test_itsdangerous/test_encoding.py -q
  • /Volumes/STOREJET/2/Dependencies/itsdangerous-py314-venv/bin/python -m pytest tests/test_itsdangerous/test_url_safe.py -q
  • /Volumes/STOREJET/2/Dependencies/itsdangerous-py314-venv/bin/python -m py_compile src/itsdangerous/encoding.py tests/test_itsdangerous/test_encoding.py
  • git diff --check

Fixes #420

@davidism davidism closed this Jul 2, 2026
@davidism davidism changed the title Keep URL-safe base64 decoding strict AI junk Jul 2, 2026
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]

2 participants