Tal Einat <talei...@gmail.com> added the comment:

> I think what I _really_ want as a user is for b64decode to reject strings 
> containing...

Do you mean you'd like to have this behavior by default?  One can already use 
validate=True to have invalid characters cause an exception.  I too find it 
surprising the False is the default, but changing this would be backwards 
incompatible.

> I find the "1 more than a multiple of 4" wording a bit clunky, and 
> potentially misleading.

I chose that to avoid mentioning "modulu" or "remainder".  I find it 
straightforward and clear, though admittedly a bit long and clumsy.  I don't 
believe it is inherently misleading, though.

I like your idea of including the number of base64 characters in the error 
message.  I find the phrase "base64 characters" ambiguous, though.  I suggest: 
"Invalid base64-encoded string: number of data characters (13) cannot be 1 more 
than a multiple of 4"

----------

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

Reply via email to