represented in the output stream by a string derived from a template filled
in with information about the part.
-.. class:: DecodedGenerator(outfp, mangle_from_=None, maxheaderlen=78, fmt=None)
+.. class:: DecodedGenerator(outfp, mangle_from_=None, maxheaderlen=None, \
+ fmt=None, *, policy=None)
Act like :class:`Generator`, except that for any subpart of the message
passed to :meth:`Generator.flatten`, if the subpart is of main type
"[Non-text (%(type)s) part of message omitted, filename %(filename)s]"
Optional *_mangle_from_* and *maxheaderlen* are as with the
- :class:`Generator` base class, except that the default value for
- *maxheaderlen* is ``78`` (the RFC standard default header length).
+ :class:`Generator` base class.
.. rubric:: Footnotes
The :mod:`email.mime` classes now all accept an optional *policy* keyword.
(Contributed by Berker Peksag in :issue:`27331`.)
+The :class:`~email.generator.DecodedGenerator` now supports the *policy*
+keyword.
+
encodings
---------
On Windows, added the ``'oem'`` encoding to use ``CP_OEMCP`` and the ``'ansi'``
alias for the existing ``'mbcs'`` encoding, which uses the ``CP_ACP`` code page.
+
faulthandler
------------
Like the Generator base class, except that non-text parts are substituted
with a format string representing the part.
"""
- def __init__(self, outfp, mangle_from_=None, maxheaderlen=78, fmt=None):
+ def __init__(self, outfp, mangle_from_=None, maxheaderlen=None, fmt=None, *,
+ policy=None):
"""Like Generator.__init__() except that an additional optional
argument is allowed.
[Non-text (%(type)s) part of message omitted, filename %(filename)s]
"""
- Generator.__init__(self, outfp, mangle_from_, maxheaderlen)
+ Generator.__init__(self, outfp, mangle_from_, maxheaderlen,
+ policy=policy)
if fmt is None:
self._fmt = _FMT
else:
Library
-------
+- email.generator.DecodedGenerator now supports the policy keyword.
+
- Issue #28027: Remove undocumented modules from ``Lib/plat-*``: IN, CDROM,
DLFCN, TYPES, CDIO, and STROPTS.