-
-
Notifications
You must be signed in to change notification settings - Fork 30.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bpo-40944: email.message.EmailMessage address parser fix #20790
Conversation
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA). Recognized GitHub usernameWe couldn't find a bugs.python.org (b.p.o) account corresponding to the following GitHub usernames: This might be simply due to a missing "GitHub Name" entry in one's b.p.o account settings. This is necessary for legal reasons before we can look at this contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. You can check yourself to see if the CLA has been received. Thanks again for the contribution, we look forward to reviewing it! |
@qs, please sign the CLA as requested by the bot in a previous message. Thank you! |
@csabella yes, I did, my username https://bugs.python.org/user34926 However, the online check shows I haven't signed. |
@qs Thanks! Let's give it a few days and then we'll check it again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add tests?
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase And if you don't make the requested changes, you will be put in the comfy chair! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
@@ -0,0 +1 @@ | |||
Fix email.message.EmailMessage address parser handling empty domain e.g. ``"example@"``. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be in the Library section.
Lib/email/_header_value_parser.py
Outdated
if not value: | ||
raise errors.HeaderParseError( | ||
"expected name-addr but but found '{}'".format(value)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that this check is redundant, this function is never called with empty value. But let's leave it just in case.
Thank you for your contribution @qs. I do not know whether you are active now, so I added tests myself, and also fixed similar errors in several other place. |
Thanks @qs for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12. |
…, address, routes, etc (pythonGH-20790) (cherry picked from commit 1aa8bbe) Co-authored-by: Ivan Savin <acccko@gmail.com> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
GH-117974 is a backport of this pull request to the 3.12 branch. |
…, address, routes, etc (pythonGH-20790) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
email.message.EmailMessage address parser fails to handle 'example@' assuming that
value
parameter is not empty. Fixed in several places.https://bugs.python.org/issue40944