]> granicus.if.org Git - python/commit
#14731: refactor email policy framework.
authorR David Murray <rdmurray@bitdance.com>
Fri, 25 May 2012 19:01:48 +0000 (15:01 -0400)
committerR David Murray <rdmurray@bitdance.com>
Fri, 25 May 2012 19:01:48 +0000 (15:01 -0400)
commitc27e52265b7ff4aa57dc357c289cce8c9dd0fec3
treeb2a25260b0aa89d0a4db3c0d2f91c8cb5e68d51a
parent9242c1378f77214f5b9b90149861cb13ca986fb0
#14731: refactor email policy framework.

This patch primarily does two things: (1) it adds some internal-interface
methods to Policy that allow for Policy to control the parsing and folding of
headers in such a way that we can construct a backward compatibility policy
that is 100% compatible with the 3.2 API, while allowing a new policy to
implement the email6 API.  (2) it adds that backward compatibility policy and
refactors the test suite so that the only differences between the 3.2
test_email.py file and the 3.3 test_email.py file is some small changes in
test framework and the addition of tests for bugs fixed that apply to the 3.2
API.

There are some additional teaks, such as moving just the code needed for the
compatibility policy into _policybase, so that the library code can import
only _policybase.  That way the new code that will be added for email6
will only get imported when a non-compatibility policy is imported.
15 files changed:
Doc/library/email.generator.rst
Doc/library/email.policy.rst
Lib/email/_policybase.py [new file with mode: 0644]
Lib/email/architecture.rst [new file with mode: 0644]
Lib/email/feedparser.py
Lib/email/generator.py
Lib/email/message.py
Lib/email/parser.py
Lib/email/policy.py
Lib/email/utils.py
Lib/test/test_email/__init__.py
Lib/test/test_email/test_email.py
Lib/test/test_email/test_generator.py
Lib/test/test_email/test_parser.py [new file with mode: 0644]
Lib/test/test_email/test_policy.py