New submission from Jakub Wilk:

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", "p...@example.com")
msg['To'] = (Address("Penelope Pussycat", "penel...@example.com"),
             Address("Fabrette Pussycat", "fabre...@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="p...@example.com")
...

----------
assignee: docs@python
components: Documentation
messages: 260796
nosy: docs@python, jwilk
priority: normal
severity: normal
status: open
title: email examples: incorrect use of email.headerregistry.Address

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue26426>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to