Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-91400: make sure email parsing dont unquote realnames with spaces#92638

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
carlbordum wants to merge6 commits intopython:main
base:main
Choose a base branch
Loading
fromcarlbordum:91400-formataddr

Conversation

carlbordum
Copy link
Contributor

@carlbordumcarlbordum commentedMay 10, 2022
edited by gpshead
Loading

"Quote the name" portion of an email address inemail.utils.formataddr() when it contains any spaces.

This way it describes the observable behavior change. Rather than the more broad wording that'd make a guarantee we don't actually test exhaustively for.
running it a second time when a round tripped identical value has already been guaranteed doesn't do anything.  Though it was meaningful during the original bug report, in correct code it is not.
@gpsheadgpshead self-assigned thisMar 17, 2023
@gpsheadgpshead added type-bugAn unexpected behavior, bug, or error stdlibPython modules in the Lib dir topic-email needs backport to 3.11only security fixes needs backport to 3.10only security fixes labelsMar 17, 2023
@gpshead
Copy link
Member

any objections from folks on email-team?

there is a caveat to this bug fix: anyone who had been working around it by doing their own test for characters and adding ""s when it wouldn't already be quoted by our existing code will now wind up with extra properly escaped " characters within their result.

that doesn't seem like a bad problem though, it is a valid address. Attempting to detect and handle that as a special case would be messy logic and lead to potentially worse outcomes of intended ""s that should be escaped not being preserved.

@arhadthedev
Copy link
Member

ping @python/email-team

@hugovkhugovk removed the needs backport to 3.10only security fixes labelApr 8, 2023
@serhiy-storchakaserhiy-storchaka added needs backport to 3.12only security fixes needs backport to 3.13bugs and security fixes and removed needs backport to 3.11only security fixes labelsMay 9, 2024
Copy link
Member

@hugovkhugovk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

any objections from folks on email-team?

~Two years later and no objections, let's merge this.

@bitdancer
Copy link
Member

Thanks for working on this, but see my analysis on the issue. The problem isn't with formataddr, which does the right thing, it's with parseaddr.

Copy link
Member

@bitdancerbitdancer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

formataddr does the right thing. It's parseaddr that would need a fix, as well as _headervalueparser.

@bedevere-app
Copy link

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 phraseI 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.

@hugovkhugovk removed the needs backport to 3.12only security fixes labelApr 26, 2025
@serhiy-storchakaserhiy-storchaka added the needs backport to 3.14bugs and security fixes labelMay 8, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@AkuliAkuliAkuli left review comments

@bitdancerbitdancerbitdancer requested changes

@gpsheadgpsheadgpshead approved these changes

@hugovkhugovkhugovk approved these changes

Assignees

@gpsheadgpshead

Labels
awaiting changesneeds backport to 3.13bugs and security fixesneeds backport to 3.14bugs and security fixesstdlibPython modules in the Lib dirtopic-emailtype-bugAn unexpected behavior, bug, or error
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

8 participants
@carlbordum@gpshead@arhadthedev@bitdancer@hugovk@Akuli@serhiy-storchaka@bedevere-bot

[8]ページ先頭

©2009-2025 Movatter.jp