summaryrefslogtreecommitdiffstats
path: root/Doc/library/email.policy.rst
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2015-05-17 18:24:33 (GMT)
committerR David Murray <rdmurray@bitdance.com>2015-05-17 18:24:33 (GMT)
commitfdb23c2fe5499d26701fa34873c1cdc347adcb80 (patch)
tree1f65d6f676b2feb7ee7c0e24068ca67160d91407 /Doc/library/email.policy.rst
parent224ef3ec3b0758956789c4c98e6cc93704304419 (diff)
downloadcpython-fdb23c2fe5499d26701fa34873c1cdc347adcb80.zip
cpython-fdb23c2fe5499d26701fa34873c1cdc347adcb80.tar.gz
cpython-fdb23c2fe5499d26701fa34873c1cdc347adcb80.tar.bz2
#20098: add mangle_from_ policy option.
This defaults to True in the compat32 policy for backward compatibility, but to False for all new policies. Patch by Milan Oberkirch, with a few tweaks.
Diffstat (limited to 'Doc/library/email.policy.rst')
-rw-r--r--Doc/library/email.policy.rst27
1 files changed, 27 insertions, 0 deletions
diff --git a/Doc/library/email.policy.rst b/Doc/library/email.policy.rst
index 9fadfb3..6e13186 100644
--- a/Doc/library/email.policy.rst
+++ b/Doc/library/email.policy.rst
@@ -187,6 +187,18 @@ added matters. To illustrate::
:const:`False` (the default), defects will be passed to the
:meth:`register_defect` method.
+
+
+ .. attribute:: mangle_from\_
+
+ If :const:`True`, lines starting with *"From "* in the body are
+ escaped by putting a ``>`` in front of them. This parameter is used when
+ the message is being serialized by a generator.
+ Default: :const:`False`.
+
+ .. versionadded:: 3.5
+ The *mangle_from_* parameter.
+
The following :class:`Policy` method is intended to be called by code using
the email library to create policy instances with custom settings:
@@ -319,6 +331,13 @@ added matters. To illustrate::
:const:`compat32`, that is used as the default policy. Thus the default
behavior of the email package is to maintain compatibility with Python 3.2.
+ The following attributes have values that are different from the
+ :class:`Policy` default:
+
+ .. attribute:: mangle_from_
+
+ The default is ``True``.
+
The class provides the following concrete implementations of the
abstract methods of :class:`Policy`:
@@ -356,6 +375,14 @@ added matters. To illustrate::
line breaks and any (RFC invalid) binary data it may contain.
+An instance of :class:`Compat32` is provided as a module constant:
+
+.. data:: compat32
+
+ An instance of :class:`Compat32`, providing backward compatibility with the
+ behavior of the email package in Python 3.2.
+
+
.. note::
The documentation below describes new policies that are included in the