mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
#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:
parent
b5267631cb
commit
dcaf2ece6c
2 changed files with 23 additions and 1 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue