Robert Xiao added the comment:

This sounds reasonable. I ran into a similar issue today trying to decode a 
JSON Web Key. Although I don't have any real say, I'd say that if you put 
together a patch it may have a higher chance to get reviewed.

I wonder about the following:

- What about adding a new kwarg to b64decode, passed through by 
urlsafe_b64decode, called "checkpad=True" which validates padding? Then we can 
just set that False when we need.
- At the same time it might be nice to pass "validate=False" through from 
urlsafe_b64decode and friends, so we can have some nicer validation of data.
- I like adding the "padding=True" arg to encode, but it may not be necessary 
given the ease of ".rstrip('=')" as an alternative. Anyway, if you will add it 
to encode, please add it to b64encode and pass through from the variant 
encoders to unify the API somewhat.

If you are still interested in putting together a patch, post a comment. 
Otherwise I may work on a patch for this.

----------
nosy: +nneonneo
versions: +Python 3.6

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

Reply via email to