diff --git a/Lib/email/_policybase.py b/Lib/email/_policybase.py index f4140fd67e4332..12211158f4699b 100644 --- a/Lib/email/_policybase.py +++ b/Lib/email/_policybase.py @@ -90,7 +90,7 @@ def __add__(self, other): """ return self.clone(**other.__dict__) -def validate_header(name, value): +def validate_header(name): # Validate header name according to RFC 5322 import re if not re.match(r'^[^\s:]+$', name): @@ -322,7 +322,7 @@ def header_store_parse(self, name, value): """+ The name and value are returned unmodified. """ - validate_header(name, value) + validate_header(name) return (name, value) def header_fetch_parse(self, name, value): diff --git a/Lib/email/policy.py b/Lib/email/policy.py index 88fe13e56cdde3..48e6b2340e2c61 100644 --- a/Lib/email/policy.py +++ b/Lib/email/policy.py @@ -140,7 +140,7 @@ def header_store_parse(self, name, value): """ if hasattr(value, 'name') and value.name.lower() == name.lower(): return (name, value) - validate_header(name, value) + validate_header(name) if isinstance(value, str) and len(value.splitlines())>1: # XXX this error message isn't quite right when we use splitlines # (see issue 22233), but I'm not sure what should happen here.