R. David Murray added the comment:

No, but you can do this:

  >>> utils.getaddresses(['a...@example.com, b...@example.com'])
  [('', 'a...@example.com'), ('', 'b...@example.com')]

Not the worlds most intuitive API, I know...which is why we have implemented a 
new improved API.  In 3.3, by using the new (provisional) policies, you can get 
a parsed list of addresses right from the Message object, without having to do 
any further processing yourself:

  >>> import email.policy
  >>> m = email.message_from_string('To: a...@example.com, 
b...@example.com\n\n', policy=email.policy.default)
  >>> m['to']
  'a...@example.com, b...@example.com'
  >>> m['to'].addresses
  (Address(display_name='', username='a', domain='example.com'), 
Address(display_name='', username='b', domain='example.com'))

This new code is not as battle tested as the old code, so I need people to try 
using it in order to find the bugs :)

----------
resolution:  -> out of date
stage:  -> committed/rejected
status: open -> closed

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

Reply via email to