diff options
author | R David Murray <rdmurray@bitdance.com> | 2011-04-08 00:54:03 (GMT) |
---|---|---|
committer | R David Murray <rdmurray@bitdance.com> | 2011-04-08 00:54:03 (GMT) |
commit | e1292a25d8a063dcc97111cd2b0239dc1aef5aa2 (patch) | |
tree | 0d68cb6cb3d2207cf5d52f87b017f02939cb4c37 /Lib/email/header.py | |
parent | 7da4db118e7899a64ef3b315f63c37ec0dbd2253 (diff) | |
download | cpython-e1292a25d8a063dcc97111cd2b0239dc1aef5aa2.zip cpython-e1292a25d8a063dcc97111cd2b0239dc1aef5aa2.tar.gz cpython-e1292a25d8a063dcc97111cd2b0239dc1aef5aa2.tar.bz2 |
#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/header.py')
-rw-r--r-- | Lib/email/header.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/email/header.py b/Lib/email/header.py index da739d5..a7963ac 100644 --- a/Lib/email/header.py +++ b/Lib/email/header.py @@ -464,12 +464,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: @@ -484,7 +485,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. |