Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
7dedcb46
Commit
7dedcb46
authored
Mar 15, 2011
by
R David Murray
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#11555: update doc for 3.x change to as_string mangle_from default.
parent
8beaa6c2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
Doc/library/email.message.rst
Doc/library/email.message.rst
+4
-3
Lib/email/message.py
Lib/email/message.py
+1
-2
No files found.
Doc/library/email.message.rst
View file @
7dedcb46
...
...
@@ -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_=
Fals
e, maxheaderlen=60)
g = Generator(fp, mangle_from_=
Tru
e, maxheaderlen=60)
g.flatten(msg)
text = fp.getvalue()
...
...
Lib/email/message.py
View file @
7dedcb46
...
...
@@ -136,8 +136,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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment