gh-100884: email/_header_value_parser: don't encode list separators (GH-100885)

ListSeparator should not be encoded. This could happen when a long line
pushes its separator to the next line, which would have been encoded.
This commit is contained in:
Thomas Weißschuh 2024-02-17 11:13:46 +01:00 committed by GitHub
parent 465db27cb9
commit 09fab93c3d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 9 additions and 1 deletions

View file

@ -2985,6 +2985,11 @@ class TestFolding(TestEmailBase):
'=?utf-8?q?H=C3=BCbsch?= Kaktus <beautiful@example.com>,\n'
' =?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>'
self._test(parser.get_address_list(to)[0],
'0123456789' * 8 + '@foo,\n =?utf-8?q?=C3=A4?= <foo@bar>\n')
# XXX Need tests with comments on various sides of a unicode token,
# and with unicode tokens in the comments. Spaces inside the quotes
# currently don't do the right thing.