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-81074: Allow non-ASCII addr_spec in email.headerregistry.Address#122477

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
medmunds wants to merge9 commits intopython:main
base:main
Choose a base branch
Loading
frommedmunds:fix-issue-81074

Conversation

medmunds
Copy link
Contributor

@medmundsmedmunds commentedJul 30, 2024
edited
Loading

The email.headerregistry.Address constructor raised an error if addr_spec contained a non-ASCII character. (But it fully supports non-ASCII in the separate username and domain args.) This change removes the error for a non-ASCII addr_spec.

This PR implements@bitdancer's suggested fix from#81074 (comment):

… But with RFC6532 support, it should be valid to have a local part that has non-ascii in an Address, and the error, as I noted above, should be raised only at serialization time and when we don't have an original source string. So that raise should be modified to explicitly ignore the NonASCIILocalPartDefect.

(The other bugs discussed in that comment are reported separately as#83938 and#122476.)

Fixesgh-81074

The email.headerregistry.Address constructor raised an error ifaddr_spec contained a non-ASCII character. (But it fully supportsnon-ASCII in the separate username and domain args.) This changeremoves the error for a non-ASCII addr_spec.
@medmundsmedmunds requested a review froma team as acode ownerJuly 30, 2024 19:16
@ghost
Copy link

ghost commentedJul 30, 2024
edited by ghost
Loading

All commit authors signed the Contributor License Agreement.
CLA signed

@bedevere-app
Copy link

Most changes to Pythonrequire a NEWS entry. Add one using theblurb_it web app or theblurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply theskip news label instead.

medmundsand others added4 commitsSeptember 9, 2024 14:06
The email.headerregistry.Address constructor raised an error ifaddr_spec contained a non-ASCII character. (But it fully supportsnon-ASCII in the separate username and domain args.) This changeremoves the error for a non-ASCII addr_spec.
@encukou
Copy link
Member

@bitdancer, as theemail expert, do you want to review this?

@bitdancer
Copy link
Member

Yes, I'll add it to my list. It will take me quite some time to get through the backlog, unfortunately.

encukou reacted with heart emoji

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

When parsing email messages from Unicode strings (but not bytes),get_local_part() recorded a NonASCIILocalPartDefect for non-ASCIIcharacters. RFC 5322 permits such addresses.This change:- removes the parse-time detection for a non-ASCII local-part  (and a related test)- adds tests for passing a non-ASCII addr_spec to  email.headerregistry.Address.__init__()- marks the (undocumented) email.errors.NonASCIILocalPartDefect  as unused and deprecated This affected parsing email messages from Unicode strings(but not from bytes), and also prevented
@medmunds
Copy link
ContributorAuthor

I have made the requested changes; please review again

@bedevere-app
Copy link

Thanks for making the requested changes!

@bitdancer: please review the changes made to this pull request.

@bedevere-appbedevere-appbot requested a review frombitdancerMay 26, 2025 23:19
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@bitdancerbitdancerAwaiting requested review from bitdancer

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

email.headerregistry.Address blocks Unicode local part addr_spec accepted elsewhere
5 participants
@medmunds@encukou@bitdancer@ZeroIntensity@picnixz

[8]ページ先頭

©2009-2025 Movatter.jp