summaryrefslogtreecommitdiffstats
path: root/Lib/email
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2013-02-04 20:25:06 (GMT)
committerR David Murray <rdmurray@bitdance.com>2013-02-04 20:25:06 (GMT)
commit2c4f6e8693fa648e98ba986f57e7ef586da6b371 (patch)
treed37e65696ac8a205d3497320c2152960f2828160 /Lib/email
parent88eea543d67218a08c7c7e006898a380e09935b1 (diff)
parent844b0e69717bf97bd7fbd055368ac398b99ec7e1 (diff)
downloadcpython-2c4f6e8693fa648e98ba986f57e7ef586da6b371.zip
cpython-2c4f6e8693fa648e98ba986f57e7ef586da6b371.tar.gz
cpython-2c4f6e8693fa648e98ba986f57e7ef586da6b371.tar.bz2
Merge #16811: Fix folding of headers with no value in provisional policies.
Diffstat (limited to 'Lib/email')
-rw-r--r--Lib/email/policy.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/email/policy.py b/Lib/email/policy.py
index 32cad0d..a17f598 100644
--- a/Lib/email/policy.py
+++ b/Lib/email/policy.py
@@ -173,7 +173,7 @@ class EmailPolicy(Policy):
lines = value.splitlines()
refold = (self.refold_source == 'all' or
self.refold_source == 'long' and
- (len(lines[0])+len(name)+2 > maxlen or
+ (lines and len(lines[0])+len(name)+2 > maxlen or
any(len(x) > maxlen for x in lines[1:])))
if refold or refold_binary and _has_surrogates(value):
return self.header_factory(name, ''.join(lines)).fold(policy=self)