mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
gh-118643: Fix AttributeError in the email module (GH-119099)
Fix regression introduced in gh-100884: AttributeError when re-fold a long address list. Also fix more cases of incorrect encoding of the address separator in the address list missed in gh-100884.
This commit is contained in:
parent
aee8f03abb
commit
858b9e85fc
3 changed files with 24 additions and 5 deletions
|
@ -3077,9 +3077,17 @@ class TestFolding(TestEmailBase):
|
|||
' =?utf-8?q?bei=C3=9Ft_bei=C3=9Ft?= <biter@example.com>\n')
|
||||
|
||||
def test_address_list_with_list_separator_after_fold(self):
|
||||
to = '0123456789' * 8 + '@foo, ä <foo@bar>'
|
||||
a = 'x' * 66 + '@example.com'
|
||||
to = f'{a}, "Hübsch Kaktus" <beautiful@example.com>'
|
||||
self._test(parser.get_address_list(to)[0],
|
||||
'0123456789' * 8 + '@foo,\n =?utf-8?q?=C3=A4?= <foo@bar>\n')
|
||||
f'{a},\n =?utf-8?q?H=C3=BCbsch?= Kaktus <beautiful@example.com>\n')
|
||||
|
||||
a = '.' * 79
|
||||
to = f'"{a}" <xyz@example.com>, "Hübsch Kaktus" <beautiful@example.com>'
|
||||
self._test(parser.get_address_list(to)[0],
|
||||
f'{a}\n'
|
||||
' <xyz@example.com>, =?utf-8?q?H=C3=BCbsch?= Kaktus '
|
||||
'<beautiful@example.com>\n')
|
||||
|
||||
# XXX Need tests with comments on various sides of a unicode token,
|
||||
# and with unicode tokens in the comments. Spaces inside the quotes
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue