diff options
author | R David Murray <rdmurray@bitdance.com> | 2014-02-08 13:12:00 -0500 |
---|---|---|
committer | R David Murray <rdmurray@bitdance.com> | 2014-02-08 13:12:00 -0500 |
commit | 0400d33928e6b463db164836da670700f03edc5d (patch) | |
tree | 70c96ca143468dfe5e7fcfc827fc32bf37d4ff4b /Lib/test/test_email/test_headerregistry.py | |
parent | 905c8c3d8dfe081d91e399aa5fd93d1659655264 (diff) | |
download | cpython-0400d33928e6b463db164836da670700f03edc5d.tar.gz cpython-0400d33928e6b463db164836da670700f03edc5d.zip |
#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.
Diffstat (limited to 'Lib/test/test_email/test_headerregistry.py')
-rw-r--r-- | Lib/test/test_email/test_headerregistry.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_email/test_headerregistry.py b/Lib/test/test_email/test_headerregistry.py index f829f83e320..adaf3e8fe45 100644 --- a/Lib/test/test_email/test_headerregistry.py +++ b/Lib/test/test_email/test_headerregistry.py @@ -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 |