#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.
This commit is contained in:
R David Murray 2012-05-25 22:53:12 -04:00
parent b5267631cb
commit dcaf2ece6c
2 changed files with 23 additions and 1 deletions

View file

@ -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))