-
-
Notifications
You must be signed in to change notification settings - Fork 33.6k
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
medmunds
wants to merge
9
commits into
python:main
Choose a base branch
from
medmunds:fix-issue-81074
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 4 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
b624a07
Allow non-ASCII addr_spec in email.headerregistry.Address
medmunds 6b58716
📜🤖 Added by blurb_it.
blurb-it[bot] f8a1296
Allow non-ASCII addr_spec in email.headerregistry.Address
medmunds 7a0243f
📜🤖 Added by blurb_it.
blurb-it[bot] 2fcd186
Merge branch 'main' into fix-issue-81074
medmunds 3024a2d
Merge branch 'main' into fix-issue-81074
picnixz 7a09aab
Merge branch 'main' into fix-issue-81074
medmunds 22dd204
Merge remote-tracking branch 'origin/fix-issue-81074' into fix-issue-…
medmunds 9099083
Stop using NonASCIILocalPartDefect in email._header_value_parser
medmunds File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1492,17 +1492,19 @@ def test_quoting(self): | |
| self.assertEqual(str(a), '"Sara J." <"bad name"@example.com>') | ||
|
|
||
| def test_il8n(self): | ||
| a = Address('Éric', 'wok', 'exàmple.com') | ||
| a = Address('Éric', 'wők', 'exàmple.com') | ||
| self.assertEqual(a.display_name, 'Éric') | ||
| self.assertEqual(a.username, 'wok') | ||
| self.assertEqual(a.username, 'wők') | ||
| self.assertEqual(a.domain, 'exàmple.com') | ||
| self.assertEqual(a.addr_spec, 'wok@exàmple.com') | ||
| self.assertEqual(str(a), 'Éric <wok@exàmple.com>') | ||
| self.assertEqual(a.addr_spec, 'wők@exàmple.com') | ||
| self.assertEqual(str(a), 'Éric <wők@exàmple.com>') | ||
|
|
||
| # XXX: there is an API design issue that needs to be solved here. | ||
| #def test_non_ascii_username_raises(self): | ||
| # with self.assertRaises(ValueError): | ||
| # Address('foo', 'wők', 'example.com') | ||
| def test_i18n_in_addr_spec(self): | ||
| a = Address(addr_spec='wők@exàmple.com') | ||
| self.assertEqual(a.username, 'wők') | ||
| self.assertEqual(a.domain, 'exàmple.com') | ||
| self.assertEqual(a.addr_spec, 'wők@exàmple.com') | ||
| self.assertEqual(str(a), 'wők@exàmple.com') | ||
|
|
||
| def test_crlf_in_constructor_args_raises(self): | ||
| cases = ( | ||
|
|
@@ -1523,10 +1525,6 @@ def test_crlf_in_constructor_args_raises(self): | |
| with self.subTest(kwargs=kwargs), self.assertRaisesRegex(ValueError, "invalid arguments"): | ||
| Address(**kwargs) | ||
|
|
||
| def test_non_ascii_username_in_addr_spec_raises(self): | ||
| with self.assertRaises(ValueError): | ||
| Address('foo', addr_spec='wő[email protected]') | ||
|
|
||
| def test_address_addr_spec_and_username_raises(self): | ||
| with self.assertRaises(TypeError): | ||
| Address('foo', username='bing', addr_spec='bar@baz') | ||
|
|
||
1 change: 1 addition & 0 deletions
1
Misc/NEWS.d/next/Library/2024-07-30-19-19-33.gh-issue-81074.YAeWNf.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Allow non-ASCII addr_spec in email.headerregistry.Address constructor |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.