summaryrefslogtreecommitdiffstats
path: root/Lib/email/_header_value_parser.py
diff options
context:
space:
mode:
authorMatthieu Caneill <matthieucan@users.noreply.github.com>2024-07-18 12:48:05 (GMT)
committerGitHub <noreply@github.com>2024-07-18 12:48:05 (GMT)
commitcecaceea31f32f01b5617989e3dc8b2077f53f89 (patch)
tree3589e6591f22f76ab6b7191d483a29a92fdfb9fd /Lib/email/_header_value_parser.py
parent1056f2bc208bdfe562c79d2a5098723c50ae9c23 (diff)
downloadcpython-cecaceea31f32f01b5617989e3dc8b2077f53f89.zip
cpython-cecaceea31f32f01b5617989e3dc8b2077f53f89.tar.gz
cpython-cecaceea31f32f01b5617989e3dc8b2077f53f89.tar.bz2
gh-120930: Remove extra blank occuring in wrapped encoded words in email headers (GH-121747)
Diffstat (limited to 'Lib/email/_header_value_parser.py')
-rw-r--r--Lib/email/_header_value_parser.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/Lib/email/_header_value_parser.py b/Lib/email/_header_value_parser.py
index ab3c303..7da1bba 100644
--- a/Lib/email/_header_value_parser.py
+++ b/Lib/email/_header_value_parser.py
@@ -2988,6 +2988,7 @@ def _fold_as_ew(to_encode, lines, maxlen, last_ew, ew_combine_allowed, charset,
excess = len(encoded_word) - remaining_space
lines[-1] += encoded_word
to_encode = to_encode[len(to_encode_word):]
+ leading_whitespace = ''
if to_encode:
lines.append(' ')