summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_email/test__header_value_parser.py
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2013-07-11 19:52:57 (GMT)
committerR David Murray <rdmurray@bitdance.com>2013-07-11 19:52:57 (GMT)
commit65171b28e77f589a490335c8749a24151e1d8817 (patch)
tree6377dcdda4bad3baec23587cf016587858bbeaca /Lib/test/test_email/test__header_value_parser.py
parent3641a74e1c03ce153042d2c21639e5b6b9604f3b (diff)
downloadcpython-65171b28e77f589a490335c8749a24151e1d8817.zip
cpython-65171b28e77f589a490335c8749a24151e1d8817.tar.gz
cpython-65171b28e77f589a490335c8749a24151e1d8817.tar.bz2
#18044: Fix parsing of encoded words of the form =?utf8?q?=XX...?=
The problem was I was only checking for decimal digits after the third '?', not for *hex* digits :(. This changeset also fixes a couple of comment typos, deletes an unused function relating to encoded word parsing, and removed an invalid 'if' test from the folding function that was revealed by the tests written to validate this issue.
Diffstat (limited to 'Lib/test/test_email/test__header_value_parser.py')
-rw-r--r--Lib/test/test_email/test__header_value_parser.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_email/test__header_value_parser.py b/Lib/test/test_email/test__header_value_parser.py
index 6101e19..8917447 100644
--- a/Lib/test/test_email/test__header_value_parser.py
+++ b/Lib/test/test_email/test__header_value_parser.py
@@ -170,6 +170,15 @@ class TestParser(TestParserMixin, TestEmailBase):
[],
'')
+ def test_get_encoded_word_quopri_utf_escape_follows_cte(self):
+ # Issue 18044
+ self._test_get_x(parser.get_encoded_word,
+ '=?utf-8?q?=C3=89ric?=',
+ 'Éric',
+ 'Éric',
+ [],
+ '')
+
# get_unstructured
def _get_unst(self, value):