mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
#16983: Apply postel's law to encoded words inside quoted strings.
This applies only to the new parser. The old parser decodes encoded words inside quoted strings already, although it gets the whitespace wrong when it does so. This version of the patch only handles the most common case (a single encoded word surrounded by quotes), but I haven't seen any other variations of this in the wild yet, so its good enough for now.
This commit is contained in:
parent
905c8c3d8d
commit
0400d33928
4 changed files with 29 additions and 0 deletions
|
@ -1143,6 +1143,16 @@ class TestAddressHeader(TestHeaderBase):
|
|||
'example.com',
|
||||
None),
|
||||
|
||||
'rfc2047_atom_in_quoted_string_is_decoded':
|
||||
('"=?utf-8?q?=C3=89ric?=" <foo@example.com>',
|
||||
[errors.InvalidHeaderDefect],
|
||||
'Éric <foo@example.com>',
|
||||
'Éric',
|
||||
'foo@example.com',
|
||||
'foo',
|
||||
'example.com',
|
||||
None),
|
||||
|
||||
}
|
||||
|
||||
# XXX: Need many more examples, and in particular some with names in
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue