[Python-checkins] cpython (merge default -> default): Merged
barry.warsaw
python-checkins at python.org
Tue Mar 15 20:24:13 CET 2011
http://hg.python.org/cpython/rev/395d4426415b
changeset: 68515:395d4426415b
parent: 68514:f9d98270bcbe
parent: 68510:1c0cded97280
user: Barry Warsaw <barry at python.org>
date: Tue Mar 15 15:23:30 2011 -0400
summary:
Merged
files:
diff --git a/Doc/library/email.message.rst b/Doc/library/email.message.rst
--- a/Doc/library/email.message.rst
+++ b/Doc/library/email.message.rst
@@ -46,15 +46,16 @@
be generated or modified).
Note that this method is provided as a convenience and may not always
- format the message the way you want. For example, by default it mangles
- lines that begin with ``From``. For more flexibility, instantiate a
+ format the message the way you want. For example, by default it does
+ not do the mangling of lines that begin with ``From`` that is
+ required by the unix mbox format. For more flexibility, instantiate a
:class:`~email.generator.Generator` instance and use its :meth:`flatten`
method directly. For example::
from io import StringIO
from email.generator import Generator
fp = StringIO()
- g = Generator(fp, mangle_from_=False, maxheaderlen=60)
+ g = Generator(fp, mangle_from_=True, maxheaderlen=60)
g.flatten(msg)
text = fp.getvalue()
diff --git a/Lib/email/message.py b/Lib/email/message.py
--- a/Lib/email/message.py
+++ b/Lib/email/message.py
@@ -157,8 +157,7 @@
header.
This is a convenience method and may not generate the message exactly
- as you intend because by default it mangles lines that begin with
- "From ". For more flexibility, use the flatten() method of a
+ as you intend. For more flexibility, use the flatten() method of a
Generator instance.
"""
from email.generator import Generator
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list