]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
#26176: fix usage of Address constructor in email examples.
authorR David Murray <rdmurray@bitdance.com>
Sun, 10 Jul 2016 17:59:01 +0000 (13:59 -0400)
committerR David Murray <rdmurray@bitdance.com>
Sun, 10 Jul 2016 17:59:01 +0000 (13:59 -0400)
Patch by Nathan Harold.

Doc/includes/email-alternative-new-api.py
Doc/library/email-examples.rst

index c1255a68dfb565b6077d52d7e8e638dacaedcb74..321f727c313b1c65c5585d20d6742d41f325c327 100644 (file)
@@ -9,9 +9,9 @@ from email.utils import make_msgid
 # Create the base text message.
 msg = EmailMessage()
 msg['Subject'] = "Ayons asperges pour le déjeuner"
-msg['From'] = Address("Pepé Le Pew", "pepe@example.com")
-msg['To'] = (Address("Penelope Pussycat", "penelope@example.com"),
-             Address("Fabrette Pussycat", "fabrette@example.com"))
+msg['From'] = Address("Pepé Le Pew", "pepe", "example.com")
+msg['To'] = (Address("Penelope Pussycat", "penelope", "example.com"),
+             Address("Fabrette Pussycat", "fabrette", "example.com"))
 msg.set_content("""\
 Salut!
 
index cbbcb78e245c4092e9fc948d3cc476a197443651..ca085868b1d9f108c3523dde8f0154c407068817 100644 (file)
@@ -61,7 +61,7 @@ way we could process it:
 
 Up to the prompt, the output from the above is::
 
-    To: Penelope Pussycat <"penelope@example.com">, Fabrette Pussycat <"fabrette@example.com">
+    To: Penelope Pussycat <penelope@example.com>, Fabrette Pussycat <fabrette@example.com>
     From: Pepé Le Pew <pepe@example.com>
     Subject: Ayons asperges pour le déjeuner