Skip to content
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

Merged
merged 10 commits into from
Apr 17, 2024

Conversation

qs
Copy link
Contributor

@qs qs commented Jun 10, 2020

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

@qs qs requested a review from a team as a code owner June 10, 2020 19:12
@the-knights-who-say-ni
Copy link

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 username

We couldn't find a bugs.python.org (b.p.o) account corresponding to the following GitHub usernames:

@qs

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!

@csabella
Copy link
Contributor

@qs, please sign the CLA as requested by the bot in a previous message. Thank you!

@qs
Copy link
Contributor Author

qs commented Jun 12, 2020

@csabella yes, I did, my username https://bugs.python.org/user34926 However, the online check shows I haven't signed.

@csabella
Copy link
Contributor

@qs Thanks! Let's give it a few days and then we'll check it again.

Copy link
Member

@serhiy-storchaka serhiy-storchaka left a 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?

@bedevere-app
Copy link

bedevere-app bot commented Apr 16, 2024

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 I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

And if you don't make the requested changes, you will be put in the comfy chair!

Copy link
Member

@serhiy-storchaka serhiy-storchaka left a 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@"``.
Copy link
Member

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.

Comment on lines 1774 to 1776
if not value:
raise errors.HeaderParseError(
"expected name-addr but but found '{}'".format(value))
Copy link
Member

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.

@serhiy-storchaka serhiy-storchaka enabled auto-merge (squash) April 17, 2024 09:37
@serhiy-storchaka serhiy-storchaka added the needs backport to 3.12 bug and security fixes label Apr 17, 2024
@serhiy-storchaka
Copy link
Member

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.

@serhiy-storchaka serhiy-storchaka merged commit 1aa8bbe into python:main Apr 17, 2024
35 of 36 checks passed
@miss-islington-app
Copy link

Thanks @qs for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Apr 17, 2024
…, 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>
@bedevere-app
Copy link

bedevere-app bot commented Apr 17, 2024

GH-117974 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 bug and security fixes label Apr 17, 2024
diegorusso pushed a commit to diegorusso/cpython that referenced this pull request Apr 17, 2024
…, address, routes, etc (pythonGH-20790)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
serhiy-storchaka added a commit that referenced this pull request Apr 23, 2024
…sage-ID, address, routes, etc (GH-20790) (GH-117974)

(cherry picked from commit 1aa8bbe)

Co-authored-by: Ivan Savin <acccko@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants