mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
bpo-27513: email.utils.getaddresses() now handles Header objects (GH-13797) (GH-27242)
getaddresses() should be able to handle a Header object if passed
one.
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 89f4c34797)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
This commit is contained in:
parent
2d0492091e
commit
8c43bf1a92
3 changed files with 9 additions and 1 deletions
|
|
@ -3263,6 +3263,11 @@ def test_getaddresses_embedded_comment(self):
|
|||
addrs = utils.getaddresses(['User ((nested comment)) <foo@bar.com>'])
|
||||
eq(addrs[0][1], 'foo@bar.com')
|
||||
|
||||
def test_getaddresses_header_obj(self):
|
||||
"""Test the handling of a Header object."""
|
||||
addrs = utils.getaddresses([Header('Al Person <aperson@dom.ain>')])
|
||||
self.assertEqual(addrs[0][1], 'aperson@dom.ain')
|
||||
|
||||
def test_make_msgid_collisions(self):
|
||||
# Test make_msgid uniqueness, even with multiple threads
|
||||
class MsgidsThread(Thread):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue