diff options
author | R David Murray <rdmurray@bitdance.com> | 2015-05-17 14:24:33 -0400 |
---|---|---|
committer | R David Murray <rdmurray@bitdance.com> | 2015-05-17 14:24:33 -0400 |
commit | fdb23c2fe5499d26701fa34873c1cdc347adcb80 (patch) | |
tree | 1f65d6f676b2feb7ee7c0e24068ca67160d91407 /Doc/library/email.policy.rst | |
parent | 224ef3ec3b0758956789c4c98e6cc93704304419 (diff) | |
download | cpython-git-fdb23c2fe5499d26701fa34873c1cdc347adcb80.tar.gz |
#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.rst | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/Doc/library/email.policy.rst b/Doc/library/email.policy.rst index 9fadfb3493..6e1318672b 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 |