[issue32178] Some invalid email address groups cause an IndexError instead of a HeaderParseError
New submission from Massimiliano Torromeo : With some malformed email address list, the parser for email groups raises an `IndexError` instead of the correct `HeaderParseError`. This results in a complete failure to parse the email while it is still preferable to just ignore the malformed header. An example of such a malformed list is this: `To: :Foo ` -- components: email messages: 307285 nosy: Massimiliano Torromeo, barry, r.david.murray priority: normal pull_requests: 4556 severity: normal status: open title: Some invalid email address groups cause an IndexError instead of a HeaderParseError type: behavior versions: Python 3.4, Python 3.5, Python 3.6 ___ Python tracker <https://bugs.python.org/issue32178> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue32178] Some invalid email address groups cause an IndexError instead of a HeaderParseError
Massimiliano Torromeo added the comment: In case an address email header contains and empty string, the tokenizer return a BareQuotedString which is also a TokenList, but this list is empty and the parser fails to check this and insteads raises an IndexError. For example an email with this header will trigger the IndexError: ReplyTo: "" -- keywords: +patch pull_requests: +4558 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue32178> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue32179] Empty email address in headers triggers an IndexError
New submission from Massimiliano Torromeo : In case an address email header contains and empty string, the tokenizer return a BareQuotedString which is also a TokenList, but this list is empty and the parser fails to check this and insteads raises an IndexError. For example an email with this header will trigger the IndexError: ReplyTo: "" -- components: email messages: 307292 nosy: barry, mtorromeo, r.david.murray priority: normal pull_requests: 4559 severity: normal status: open title: Empty email address in headers triggers an IndexError type: behavior versions: Python 3.4, Python 3.5, Python 3.6 ___ Python tracker <https://bugs.python.org/issue32179> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue32178] Some invalid email address groups cause an IndexError instead of a HeaderParseError
Change by Massimiliano Torromeo : -- pull_requests: -4558 ___ Python tracker <https://bugs.python.org/issue32178> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue32178] Some invalid email address groups cause an IndexError instead of a HeaderParseError
Massimiliano Torromeo added the comment: Disregard my last message, I posted it in the wrong bug report by mistake. Sorry about the noise -- ___ Python tracker <https://bugs.python.org/issue32178> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com