Bug in email.utils, parseaddr

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Fri May 9 02:55:27 EDT 2008


En Fri, 09 May 2008 02:55:46 -0300, Roopesh <roopesh.raj at gmail.com>  
escribió:

> I tried using parseaddr of email.utils, but it gave the following
> result when the name had a comma inside.
>
>>>> e = 'K,Vishal <vishal at someaddress.biz>'
>>>> from email.utils import parseaddr
>>>> parseaddr(e)
> ('', 'K')

That's an invalid address. A comma "," is a special character and it  
cannot happen inside an atom, it must be quoted. See section 3.4 in  
RFC2822 <http://www.faqs.org/rfcs/rfc2822.html>

-- 
Gabriel Genellina




More information about the Python-list mailing list