Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork34.3k
Closed
Description
Bug report
Bug description:
An error is raised for the following valid test cases using the newly introducedignorechars parameter
importbase64assertbase64.b64decode(b'/----',altchars=b'-+',ignorechars=b'/')==b'\xfb\xef\xbe'assertbase64.b64decode(b'+----',altchars=b'/-',ignorechars=b'+')==b'\xff\xff\xff'
For both we get:
binascii.Error: Invalid base64-encoded string: number of data characters (5) cannot be 1 more than a multiple of 4In both cases, the leading byte should be ignored thus giving a 4 bytes valid input.
CPython versions tested on:
CPython main branch
Operating systems tested on:
macOS