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

2018-06-12 Thread Tal Einat
Change by Tal Einat : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.6 ___ Python tracker ___

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

2018-06-12 Thread Tal Einat
Tal Einat added the comment: New changeset 63dd1f70c1aa57494802c9b68f9db4918620fc8f by Tal Einat (Miss Islington (bot)) in branch '3.6': bpo-27397: Make email module properly handle invalid-length base64 strings (GH-7583) (GH-7665)

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

2018-06-12 Thread Tal Einat
Tal Einat added the comment: New changeset 7b82281c80d0064559866afe92f19cae5978c841 by Tal Einat (Miss Islington (bot)) in branch '3.7': bpo-27397: Make email module properly handle invalid-length base64 strings (GH-7583) (GH-7664)

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

2018-06-12 Thread miss-islington
Change by miss-islington : -- pull_requests: +7280 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

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

2018-06-12 Thread miss-islington
Change by miss-islington : -- pull_requests: +7279 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

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

2018-06-12 Thread Tal Einat
Tal Einat added the comment: New changeset c3f55be7dd012b7e92901627d0b31c21e983ccb4 by Tal Einat in branch 'master': bpo-27397: Make email module properly handle invalid-length base64 strings (#7583) https://github.com/python/cpython/commit/c3f55be7dd012b7e92901627d0b31c21e983ccb4

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

2018-06-11 Thread Tal Einat
Tal Einat added the comment: I ended up fixing this independently of #33770. AFAIK this should just work with 3.6. -- ___ Python tracker ___

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

2018-06-11 Thread Ned Deily
Ned Deily added the comment: > See #33770, which will make recognizing and handling this case > straightforward. The fix for #33770 is only in 3.7.0 and later, so does this mean this change should not be backported to 3.6? Updating the the versions accordingly. If it is appropriate for

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

2018-06-10 Thread Tal Einat
Change by Tal Einat : -- keywords: +patch pull_requests: +7205 stage: needs patch -> patch review ___ Python tracker ___ ___

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

2018-06-05 Thread Tal Einat
Tal Einat added the comment: See #33770, which will make recognizing and handling this case straightforward. -- nosy: +taleinat ___ Python tracker ___

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

2016-07-29 Thread R. David Murray
R. David Murray added the comment: Returning the undecoded payload is a good idea. Let's go with that. The email module, unlike most stdlib packages, has a mandate that the parser should never raise an error. Instead we do our best to guess (very unlike everything else in python!) and note

[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-Encoding

[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

[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 and just let

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

2016-07-28 Thread R. David Murray
R. David Murray added the comment: It might be better to add a character: that will produce garbage as the last byte, but that could serve as an alert that something is wrong...and we don't know if the extra character is at the end or at the beginning of the base64 encoded string, or if, as

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

2016-07-28 Thread R. David Murray
R. David Murray added the comment: Thanks for narrowing this down. There are two problems: the first is that the base64 module is raising "Incorrect padding" when the issue is actually that the input string cannot be decoded using the base64 algorithm no matter what padding might be

[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:

[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

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

2016-06-27 Thread R. David Murray
R. David Murray added the comment: This appears to be a bug in b64decode. It should not be raising that error if validate=False, as it is in the code being executed during the test case. It's not that b64decode is ignoring the validate argument; the error appears to be data-dependent. I

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

2016-06-26 Thread Claudiu Saftoiu
Claudiu Saftoiu added the comment: See attached another file with more test cases. -- Added file: http://bugs.python.org/file43557/bugreport_moretests.py ___ Python tracker

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

2016-06-26 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- assignee: -> r.david.murray nosy: +r.david.murray priority: normal -> high ___ Python tracker

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

2016-06-26 Thread Claudiu Saftoiu
New submission from Claudiu Saftoiu: I'm processing Yahoo! Groups backup archives, and came across an email message which causes the `.get_payload(decode=True)` step to raise an AssertionError. Particularly, the following exception is raised in `lib/python3.5/email/_encoded_words.py`, line