This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author krother
Recipients barry, krother, r.david.murray
Date 2014-10-01.21:25:23
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1412198724.14.0.970145330248.issue22535@psf.upfronthosting.co.za>
In-reply-to
Content
I am trying to create an email address as in the Python doc example 
https://docs.python.org/3/library/email-examples.html

The example does not work as given on the page.

I tried Python 3.4rc1 and the 3.5 compiled from source on Ubuntu 12.

I found two possible reasons:

1) Python bug in headerregistry.py
The string resulting from the command below contains extra quotes:

str(Address('Foo Example', 'foo@example.com'))
--> 'Foo Example <"foo@example.com">'


2) Documentation bug

The documentation of headerregistry.Address states:

"username and domain may be specified together by using 
the addr_spec keyword *instead of* the username and domain keywords"

However, this is inconsistent with example 19.1.14.1. on
https://docs.python.org/3/library/email-examples.html

Attached are two tests that reproduce the situation.
The first test below fails but the second passes.

Conclusion:
In my opinion, it is more intuitive if the following would work as well:
Address('Foo Example', 'foo@example.com')
History
Date User Action Args
2014-10-01 21:25:24krothersetrecipients: + krother, barry, r.david.murray
2014-10-01 21:25:24krothersetmessageid: <1412198724.14.0.970145330248.issue22535@psf.upfronthosting.co.za>
2014-10-01 21:25:24krotherlinkissue22535 messages
2014-10-01 21:25:23krothercreate