Issue 26426: email examples: incorrect use of email.headerregistry.Address (original) (raw)
Issue26426
Created on 2016-02-24 13:37 by jwilk, last changed 2022-04-11 14:58 by admin. This issue is now closed.
Messages (2) | ||
---|---|---|
msg260796 - (view) | Author: Jakub Wilk (jwilk) | Date: 2016-02-24 13:37 |
https://docs.python.org/3/library/email-examples.html#examples-using-the-provisional-api contains the following code: from email.headerregistry import Address ... msg['From'] = Address("Pepé Le Pew", "pepe@example.com") msg['To'] = (Address("Penelope Pussycat", "penelope@example.com"), Address("Fabrette Pussycat", "fabrette@example.com")) But Address takes just the username, not the whole email address, as the second argument. So this should be written as: msg['From'] = Address("Pepé Le Pew", "pepe", "example.com") ... or: msg['From'] = Address("Pepé Le Pew", addr_spec="pepe@example.com") ... | ||
msg260797 - (view) | Author: Berker Peksag (berker.peksag) * ![]() |
Date: 2016-02-24 13:45 |
Thanks for the report. This is a duplicate of issue 26176. Would you like to send a patch? |
History | |||
---|---|---|---|
Date | User | Action | Args |
2022-04-11 14:58:27 | admin | set | github: 70613 |
2016-02-24 13:53:53 | barry | set | nosy: + barry |
2016-02-24 13:45:47 | berker.peksag | set | status: open -> closedsuperseder: EmailMessage example doesn't worknosy: + berker.peksagmessages: + resolution: duplicatestage: resolved |
2016-02-24 13:37:42 | jwilk | create |