[issue30564] Base64 decoding gives incorrect outputs.

2017-06-04 Thread R. David Murray
R. David Murray added the comment: Actually, the API discussion may be short: we already have a 'validate' option, whose spirit matches with this, so adding the check for the padding issue to that of the non-alphabet characters check would seem to me to be quite reasonable. -- __

[issue30564] Base64 decoding gives incorrect outputs.

2017-06-04 Thread Monty Evans
Monty Evans added the comment: Ah, that is enlightening. It hadn't occured to me that you might want to allow for minor mistakes in the encoder - I must've missed that part of the standard. Thanks to both of you for clearing that up :). -- ___ Pytho

[issue30564] Base64 decoding gives incorrect outputs.

2017-06-04 Thread R. David Murray
R. David Murray added the comment: Not only is it conforming, it is required, since the primary use (originally) of the base64 module was in the email package, where generous interpretation of the input is the standard. This does not mean that adding a strict mode would be out of line, but tha

[issue30564] Base64 decoding gives incorrect outputs.

2017-06-04 Thread Gareth Rees
Gareth Rees added the comment: RFC 4648 section 3.5 says: The padding step in base 64 and base 32 encoding can, if improperly implemented, lead to non-significant alterations of the encoded data. For example, if the input is only one octet for a base 64 encoding, then all six bits of

[issue30564] Base64 decoding gives incorrect outputs.

2017-06-04 Thread Monty Evans
Changes by Monty Evans : -- components: +Library (Lib) ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://

[issue30564] Base64 decoding gives incorrect outputs.

2017-06-04 Thread Monty Evans
Changes by Monty Evans : Added file: http://bugs.python.org/file46923/b64_decoding.py ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue30564] Base64 decoding gives incorrect outputs.

2017-06-04 Thread Monty Evans
New submission from Monty Evans: Tested in Python 2.7 and 3.5 - the base64 module contains a couple of decoding methods, 'standard_b64decode()' and 'b66decode()' which incorrectly decode certain invalid base64 strings. This is outlined in detail here: "https://stackoverflow.com/questions/44347

[issue30564] Base64 decoding gives incorrect outputs.

2017-06-04 Thread Monty Evans
Changes by Monty Evans : -- nosy: ShiftedBit priority: normal severity: normal status: open title: Base64 decoding gives incorrect outputs. type: behavior versions: Python 2.7, Python 3.5 ___ Python tracker ___