Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fe0472e

Browse files
committed
Fix glitches in email.policy docs (python#12208)
1 parent 0612e8c commit fe0472e

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

Doc/library/email.policy.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,18 @@ file on disk and pass it to the system ``sendmail`` program on a Unix system::
4848
>>> import email.policy
4949
>>> from subprocess import Popen, PIPE
5050
>>> with open('mymsg.txt', 'b') as f:
51-
... Msg = msg_from_binary_file(f, policy=email.policy.mbox)
51+
... msg = msg_from_binary_file(f, policy=email.policy.mbox)
5252
>>> p = Popen(['sendmail', msg['To'][0].address], stdin=PIPE)
5353
>>> g = BytesGenerator(p.stdin, policy=email.policy.SMTP)
5454
>>> g.flatten(msg)
5555
>>> p.stdin.close()
5656
>>> rc = p.wait()
5757

58+
.. XXX email.policy.mbox/MBOX does not exist yet
59+
5860
Some email package methods accept a *policy* keyword argument, allowing the
5961
policy to be overridden for that method. For example, the following code uses
60-
the :meth:`email.message.Message.as_string` method of the *msg* object from the
62+
the :meth:`~email.message.Message.as_string` method of the *msg* object from the
6163
previous example and re-write it to a file using the native line separators for
6264
the platform on which it is running::
6365

0 commit comments

Comments
 (0)