FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

bpo-1025395: Fix email.utils.parseaddr to handle multiple hops by ioanatia · Pull Request #6917 · python/cpython · GitHub

Repository navigation

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (2) .rst  (1) No extension  (1) All 3 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
2 changes: 2 additions & 0 deletions Lib/email/_parseaddr.py
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
Expand Up @@ -338,6 +338,8 @@ def getrouteaddr(self):
elif self.field[self.pos] == '@':
self.pos += 1
expectroute = True
elif self.field[self.pos] == ',':
self.pos += 1
elif self.field[self.pos] == ':':
self.pos += 1
else:
Expand Down
6 changes: 6 additions & 0 deletions Lib/test/test_email/test_email.py
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
Expand Up @@ -3141,6 +3141,12 @@ def test_parseaddr_preserves_spaces_in_local_part(self):
self.assertEqual(('', 'merwok.wok.wok@xample.com'),
utils.parseaddr('merwok. wok . wok@xample.com'))

def test_parseaddr_handles_obsolete_addressing(self):
self.assertEqual(('foobar', 'foo@bar.com'),
utils.parseaddr('"foobar" <@hop.org:foo@bar.com>'))
self.assertEqual(('foobar', 'foo@bar.com'),
utils.parseaddr('"foobar" <@hop1.org,@hop2.org:foo@bar.com>'))

def test_formataddr_does_not_quote_parens_in_quoted_string(self):
addr = ("'foo@example.com' (foo@example.com)",
'foo@example.com')
Expand Down
1 change: 1 addition & 0 deletions Misc/ACKS
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
Expand Up @@ -1578,6 +1578,7 @@ Piotr Szczepaniak
Amir Szekely
Maciej Szulik
Joel Taddei
Ioana Tagirta
Arfrever Frehtes Taifersar Arahesis
Hideaki Takahashi
Takase Arihiro
Expand Down
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 @@
Fix email.utils.parseaddr to handle multiple hops

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I'd suggest a slight change to wrap email.utils.parseaddr in double backticks "``" so that it is rendered correctly with code in rst format.

Also, can you can add a full stop at the end of the sentence.


Back | FazBrowse Home | New Git URL