summaryrefslogtreecommitdiffstats
path: root/Lib/email/header.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2019-05-23 01:41:43 (GMT)
committerR. David Murray <rdmurray@bitdance.com>2019-05-23 01:41:43 (GMT)
commit0416d6f05a96e0f1b3751aa97abfffe6d3323976 (patch)
tree14274d5ee030e346445be5dcaf74450c7d430563 /Lib/email/header.py
parent367fe5757a707c4e3602dee807a9315199ed0b5c (diff)
downloadcpython-0416d6f05a96e0f1b3751aa97abfffe6d3323976.zip
cpython-0416d6f05a96e0f1b3751aa97abfffe6d3323976.tar.gz
cpython-0416d6f05a96e0f1b3751aa97abfffe6d3323976.tar.bz2
bpo-27737: Allow whitespace only headers encoding (GH-13478) (#13517)
(cherry picked from commit ef5bb25e2d6147cd44be9c9b166525fb30485be0) Co-authored-by: Batuhan Taşkaya <47358913+isidentical@users.noreply.github.com>
Diffstat (limited to 'Lib/email/header.py')
-rw-r--r--Lib/email/header.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/email/header.py b/Lib/email/header.py
index 7b30a03..4ab0032 100644
--- a/Lib/email/header.py
+++ b/Lib/email/header.py
@@ -431,7 +431,7 @@ class _ValueFormatter:
if end_of_line != (' ', ''):
self._current_line.push(*end_of_line)
if len(self._current_line) > 0:
- if self._current_line.is_onlyws():
+ if self._current_line.is_onlyws() and self._lines:
self._lines[-1] += str(self._current_line)
else:
self._lines.append(str(self._current_line))