Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32.3k
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
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
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.
ghost commentedJul 30, 2024 • edited by ghost
Loading Uh oh!
There was an error while loading.Please reload this page.
edited by ghost
Uh oh!
There was an error while loading.Please reload this page.
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 the |
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.
@bitdancer, as theemail expert, do you want to review this? |
Yes, I'll add it to my list. It will take me quite some time to get through the backlog, unfortunately. |
Uh oh!
There was an error while loading.Please reload this page.
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 |
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
I have made the requested changes; please review again |
Thanks for making the requested changes! @bitdancer: please review the changes made to this pull request. |
Uh oh!
There was an error while loading.Please reload this page.
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):
(The other bugs discussed in that comment are reported separately as#83938 and#122476.)
Fixesgh-81074