summaryrefslogtreecommitdiffstats
path: root/Lib/email
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2011-04-08 01:00:33 (GMT)
committerR David Murray <rdmurray@bitdance.com>2011-04-08 01:00:33 (GMT)
commit7ede59d77a9b21c5c021d1b9a4289aba11509fdd (patch)
tree940241034ad130417e46590a1a6e0f46ea6cab62 /Lib/email
parent63d320b44f3ebd42c6b7762dcb9524378b4b6c64 (diff)
parent80221ed0c0f3c73ee13c5d2c64a9b0273933a0ce (diff)
downloadcpython-7ede59d77a9b21c5c021d1b9a4289aba11509fdd.zip
cpython-7ede59d77a9b21c5c021d1b9a4289aba11509fdd.tar.gz
cpython-7ede59d77a9b21c5c021d1b9a4289aba11509fdd.tar.bz2
Merge #11492: fix header truncation on folding when there are runs of split chars.
Not a complete fix for this issue.
Diffstat (limited to 'Lib/email')
-rw-r--r--Lib/email/header.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/email/header.py b/Lib/email/header.py
index 2562b30..a0f7c45 100644
--- a/Lib/email/header.py
+++ b/Lib/email/header.py
@@ -483,12 +483,13 @@ class _ValueFormatter:
self._current_line.reset(str(holding))
return
elif not nextpart:
- # There must be some trailing split characters because we
+ # There must be some trailing or duplicated split characters
+ # because we
# found a split character but no next part. In this case we
# must treat the thing to fit as the part + splitpart because
# if splitpart is whitespace it's not allowed to be the only
# thing on the line, and if it's not whitespace we must split
- # after the syntactic break. In either case, we're done.
+ # after the syntactic break.
holding_prelen = len(holding)
holding.push(part + splitpart)
if len(holding) + len(self._current_line) <= self._maxlen:
@@ -503,7 +504,7 @@ class _ValueFormatter:
self._lines.append(str(self._current_line))
holding.reset(save_part)
self._current_line.reset(str(holding))
- return
+ holding.reset()
elif not part:
# We're leading with a split character. See if the splitpart
# and nextpart fits on the current line.