forked from python/cpython
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pythongh-118643: Fix AttributeError in the email module (pythonGH-119099
) Fix regression introduced in pythongh-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 pythongh-100884.
- Loading branch information
1 parent
aee8f03
commit 858b9e8
Showing
3 changed files
with
24 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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 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 |
---|---|---|
|
@@ -3077,9 +3077,17 @@ def test_address_list_with_unicode_names_in_quotes(self): | |
' =?utf-8?q?bei=C3=9Ft_bei=C3=9Ft?= <[email protected]>\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" <[email protected]>' | ||
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 <[email protected]>\n') | ||
|
||
a = '.' * 79 | ||
to = f'"{a}" <[email protected]>, "Hübsch Kaktus" <[email protected]>' | ||
self._test(parser.get_address_list(to)[0], | ||
f'{a}\n' | ||
' <[email protected]>, =?utf-8?q?H=C3=BCbsch?= Kaktus ' | ||
'<[email protected]>\n') | ||
|
||
# XXX Need tests with comments on various sides of a unicode token, | ||
# and with unicode tokens in the comments. Spaces inside the quotes | ||
|
2 changes: 2 additions & 0 deletions
2
Misc/NEWS.d/next/Library/2024-05-16-17-31-46.gh-issue-118643.hAWH4C.rst
This file contains 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,2 @@ | ||
Fix an AttributeError in the :mod:`email` module when re-fold a long address | ||
list. Also fix more cases of incorrect encoding of the address separator in the address list. |