]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
#10839: raise an error on add of duplicate unique headers in new email policies
authorR David Murray <rdmurray@bitdance.com>
Tue, 29 May 2012 13:14:44 +0000 (09:14 -0400)
committerR David Murray <rdmurray@bitdance.com>
Tue, 29 May 2012 13:14:44 +0000 (09:14 -0400)
commitabfc37491cecb0a052d54c3bf0525ac140e94f7e
tree90ffe814aff0fd3f921e29e619582236f6f3ebe5
parent6066fe1258d7d8dcec7459267f159d5d73d920e2
#10839: raise an error on add of duplicate unique headers in new email policies

This feature was supposed to be part of the initial email6 checkin, but it got
lost in my big refactoring.

In this patch I'm not providing an easy way to turn off the errors, but they
only happen when a header is added programmatically, and it is almost never
the right thing to do to allow the duplicate to be added.  An application that
needs to add duplicates of unique headers can create a policy subclass to
allow it.
Doc/library/email.policy.rst
Lib/email/_policybase.py
Lib/email/message.py
Lib/email/policy.py