[issue27397] email.message.Message.get_payload(decode=True) raises AssertionError that "should never happen"

2016-07-29 Thread Jami Lindh
Jami Lindh added the comment: It might also make sense to return the payload undecoded. The documentation for get_payload() function says: "[...] the payload will be decoded if this header’s value is quoted-printable or base64. If some other encoding is used, or Content-Transfer-Enc

[issue27397] email.message.Message.get_payload(decode=True) raises AssertionError that "should never happen"

2016-07-28 Thread Jami Lindh
Jami Lindh added the comment: Also, I'm not sure what is the development status in Python 3.4 but in my case this bug happened using the Debian Jessie Python version 3.4.2-2 -- versions: +Python 3.4 ___ Python tracker <rep...@bugs.python.org>

[issue27397] email.message.Message.get_payload(decode=True) raises AssertionError that "should never happen"

2016-07-28 Thread Jami Lindh
Jami Lindh added the comment: In my opinion, this is still a clear case of "invalid input, raise an error", but I don't think AssertionError is the right one. Maybe just don't catch the unexpected binascii.Error and let it fly towards the user? I might go even one step further an

[issue27397] email.message.Message.get_payload(decode=True) raises AssertionError that "should never happen"

2016-07-28 Thread Jami Lindh
Jami Lindh added the comment: I stumbled upon this bug as well while fuzzing with AFL. The curious thing is that email.message_from_string still accepts that garbled message as a valid email. -- nosy: +CryptidVulpes versions: +Python 3.4 Added file: http://bugs.python.org/file43921

[issue27397] email.message.Message.get_payload(decode=True) raises AssertionError that "should never happen"

2016-07-28 Thread Jami Lindh
Jami Lindh added the comment: I also attached a minimal script containing only the decode call and the garbage payload. -- Added file: http://bugs.python.org/file43922/issue27397_poc_minimal.py ___ Python tracker <rep...@bugs.python.org>