diff options
author | Barry Warsaw <barry@python.org> | 2011-03-15 19:23:30 (GMT) |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 2011-03-15 19:23:30 (GMT) |
commit | 5b2c8768427604be12c285e76b93524e927dc483 (patch) | |
tree | 84f6ae0ca0b4c904d11a98e7b30224cad2ddd482 | |
parent | 254800e1502a5567c8f7c8b3d8c4f0d17b3638e3 (diff) | |
parent | ab1dfd68e1dd1e5251c6dfa9bc45b10f45ce39a6 (diff) | |
download | cpython-5b2c8768427604be12c285e76b93524e927dc483.zip cpython-5b2c8768427604be12c285e76b93524e927dc483.tar.gz cpython-5b2c8768427604be12c285e76b93524e927dc483.tar.bz2 |
Merged
-rw-r--r-- | Doc/library/email.message.rst | 7 | ||||
-rw-r--r-- | Lib/email/message.py | 3 |
2 files changed, 5 insertions, 5 deletions
diff --git a/Doc/library/email.message.rst b/Doc/library/email.message.rst index 11984a5..ebe2d9c 100644 --- a/Doc/library/email.message.rst +++ b/Doc/library/email.message.rst @@ -46,15 +46,16 @@ Here are the methods of the :class:`Message` class: 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 index 28835d0..2713bc5 100644 --- a/Lib/email/message.py +++ b/Lib/email/message.py @@ -157,8 +157,7 @@ class Message: 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 |