-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
Closed
Labels
type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
>>> import binascii
>>> f = lambda s: binascii.a2b_base64(s, strict_mode=True)
>>> f('AAAA')
b'\x00\x00\x00'
>>> f('AAAA=')
b'\x00\x00\x00'
>>> f('AAAA==')
b'\x00\x00\x00'
>>> f('AAAA===')
b'\x00\x00\x00'
>>> f('AAAA====')
b'\x00\x00\x00'
>>> f('AAAA=====')
b'\x00\x00\x00'
Doc/library/binascii.rst defines that a valid base64 "Contains no excess data after padding (including excess padding, newlines, etc.)". However, current implement does not handle the edge case of excess padding after no padding.
CPython versions tested on:
3.12
Operating systems tested on:
macOS
Linked PRs
Metadata
Metadata
Assignees
Labels
type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error