New submission from Michael Harris <pw.michael.har...@gmail.com>:

When given an invalid base64 string that starts with a valid base64 substring, 
the functions will return the decoded bytes only up to the substring rather 
then ignoring the non-alphabet character.

Examples:
>>> base64.b64decode("AAAAAAAA")
b'\x00\x00\x00\x00\x00\x00'
>>> base64.b64decode("AA=AAAAAA")
b'\x00\x00\x00\x00\x00\x00'
>>> base64.b64decode("AAA=AAAAA")
b'\x00\x00'

----------
components: Library (Lib)
messages: 326630
nosy: pw.michael.harris
priority: normal
severity: normal
status: open
title: "Short circuiting" in base64's b64decode, decode, decodebytes
type: behavior
versions: Python 3.5

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue34832>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to