[issue34736] Confusing base64.b64decode output

Mark Dickinson report at bugs.python.org
Mon Sep 24 11:03:03 EDT 2018


Mark Dickinson <dickinsm at gmail.com> added the comment:

> Do you mean you'd like to have this behavior by default?

Ideally, yes, but I think that's out of scope for this bug report.

> I don't believe it is inherently misleading, though.

Yes, the "1 more than a multiple of 4" bit is clunky, but not misleading per se. It becomes misleading in combination with "length cannot be", since the obvious meaning of "length" here is the length of the string passed to the "b64decode" function, and that's not the correct interpretation in this context.

Your suggested rewording gets rid of the "length" reference, and looks like an improvement to me. "data characters" seems fairly clear, too.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34736>
_______________________________________


More information about the Python-bugs-list mailing list