summaryrefslogtreecommitdiffstats
path: root/Lib/email
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2012-05-26 02:53:12 (GMT)
committerR David Murray <rdmurray@bitdance.com>2012-05-26 02:53:12 (GMT)
commitdcaf2ece6cbd432f8ad71ca2bebc4f79e3b97fbc (patch)
tree80286278c40e341ebbe0074f450c7ec84deb5399 /Lib/email
parentb5267631cb2a62088ef12b36abd0317957244c6c (diff)
downloadcpython-dcaf2ece6cbd432f8ad71ca2bebc4f79e3b97fbc.zip
cpython-dcaf2ece6cbd432f8ad71ca2bebc4f79e3b97fbc.tar.gz
cpython-dcaf2ece6cbd432f8ad71ca2bebc4f79e3b97fbc.tar.bz2
#12586: Fix a small oversight in the new email policy header setting code.
This is a danger of focusing on unit tests: sometimes you forget to do the integration tests.
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 ea90a8f..18946c3 100644
--- a/Lib/email/policy.py
+++ b/Lib/email/policy.py
@@ -104,7 +104,7 @@ class EmailPolicy(Policy):
"""
if hasattr(value, 'name') and value.name.lower() == name.lower():
return (name, value)
- if len(value.splitlines())>1:
+ if isinstance(value, str) and len(value.splitlines())>1:
raise ValueError("Header values may not contain linefeed "
"or carriage return characters")
return (name, self.header_factory(name, value))