aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/test_email/test__header_value_parser.py
diff options
context:
space:
mode:
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 646082b4a40..32996ca4c8a 100644
--- a/Lib/test/test_email/test__header_value_parser.py
+++ b/Lib/test/test_email/test__header_value_parser.py
@@ -540,6 +540,15 @@ class TestParser(TestParserMixin, TestEmailBase):
self._test_get_x(parser.get_bare_quoted_string,
'""', '""', '', [], '')
+ # Issue 16983: apply postel's law to some bad encoding.
+ def test_encoded_word_inside_quotes(self):
+ self._test_get_x(parser.get_bare_quoted_string,
+ '"=?utf-8?Q?not_really_valid?="',
+ '"not really valid"',
+ 'not really valid',
+ [errors.InvalidHeaderDefect],
+ '')
+
# get_comment
def test_get_comment_only(self):