summaryrefslogtreecommitdiffstats
path: root/Lib/email
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2014-02-08 18:13:01 (GMT)
committerR David Murray <rdmurray@bitdance.com>2014-02-08 18:13:01 (GMT)
commit01e46ee7e28f5f14ede2b7078cfd277199751dc3 (patch)
treeab1808c55105351d4bf0a8e794e9d7eb70139d45 /Lib/email
parentff9616bbf7ecbd55a7206dae28f06ef90f270566 (diff)
parent0400d33928e6b463db164836da670700f03edc5d (diff)
downloadcpython-01e46ee7e28f5f14ede2b7078cfd277199751dc3.zip
cpython-01e46ee7e28f5f14ede2b7078cfd277199751dc3.tar.gz
cpython-01e46ee7e28f5f14ede2b7078cfd277199751dc3.tar.bz2
Merge: #16983: Apply postel's law to encoded words inside quoted strings.
Diffstat (limited to 'Lib/email')
-rw-r--r--Lib/email/_header_value_parser.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/email/_header_value_parser.py b/Lib/email/_header_value_parser.py
index 0392379..04ab84c 100644
--- a/Lib/email/_header_value_parser.py
+++ b/Lib/email/_header_value_parser.py
@@ -1556,6 +1556,13 @@ def get_bare_quoted_string(value):
while value and value[0] != '"':
if value[0] in WSP:
token, value = get_fws(value)
+ elif value[:2] == '=?':
+ try:
+ token, value = get_encoded_word(value)
+ bare_quoted_string.defects.append(errors.InvalidHeaderDefect(
+ "encoded word inside quoted string"))
+ except errors.HeaderParseError:
+ token, value = get_qcontent(value)
else:
token, value = get_qcontent(value)
bare_quoted_string.append(token)