File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ message objects.
5757 :class: `~email.policy.default ` policy, which follows the rules of the email
5858 RFCs except for line endings (instead of the RFC mandated ``\r\n ``, it uses
5959 the Python standard ``\n `` line endings). For more information see the
60- :mod: `~email.policy ` documentation.
60+ :mod: `~email.policy ` documentation. [ 2 ]_
6161
6262 .. method :: as_string(unixfrom=False, maxheaderlen=None, policy=None)
6363
@@ -749,3 +749,9 @@ message objects.
749749.. [1 ] Originally added in 3.4 as a :term: `provisional module <provisional
750750 package> `. Docs for legacy message class moved to
751751 :ref: `compat32_message `.
752+
753+ .. [2 ] The :class: `EmailMessage ` class requires a policy that provides a
754+ ``content_manager `` attribute for content management methods like
755+ ``set_content() `` and ``get_content() `` to work. The legacy
756+ :const: `~email.policy.compat32 ` policy does not support these methods
757+ and should not be used with :class: `EmailMessage `.
Original file line number Diff line number Diff line change @@ -662,6 +662,13 @@ The header objects and their attributes are described in
662662 An instance of :class: `Compat32 `, providing backward compatibility with the
663663 behavior of the email package in Python 3.2.
664664
665+ .. note ::
666+
667+ The :const: `compat32 ` policy should not be used as a policy for
668+ :class: `~email.message.EmailMessage ` objects, and should only be used
669+ to serialize messages that were created using the :const: `compat32 `
670+ policy.
671+
665672
666673.. rubric :: Footnotes
667674
You can’t perform that action at this time.
0 commit comments