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 <foo@example.com> <bar@example.com>`
|
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA). Unfortunately we couldn't find an account corresponding to your GitHub username on bugs.python.org (b.p.o) to verify you have signed the CLA (this might be simply due to a missing "GitHub Name" entry in your b.p.o account settings). This is necessary for legal reasons before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. Thanks again to your contribution and we look forward to looking at it! |
|
Thanks @mtorromeo ! This was fixed as a part of some other pull request, I am not sure which one. But I see the code has been changed to: if not value:
group.defects.append(errors.InvalidHeaderDefect(
"end of header in group"))
elif value[0] != ';':
raise errors.HeaderParseError(
"expected ';' at end of group but found {}".format(value))Can you please confirm that is the case? |
|
I moved my project to rust so I don't have a piece of code ready to test this nor do I need this fixed anymore, but I guess that change should have indeed fixed the bug. |
|
Closing since this issue seems to have been fixed by another pull request at some point. |
With some malformed email address list, the parser for email groups raises an
IndexErrorinstead of the correctHeaderParseError.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 <foo@example.com> <bar@example.com>https://bugs.python.org/issue32178