[issue42787] email.utils.getaddresses improper parsing of unicode realnames

Ross Rhodes report at bugs.python.org
Wed Dec 30 11:47:32 EST 2020


Ross Rhodes <ross.rhodes at hotmail.co.uk> added the comment:

Hi Konstantin,

Thanks for raising this issue. It appears the field provided in your example does not conform to RFC 2822 followed by this email library. Square brackets are treated as special characters in [section 3.2.1](https://tools.ietf.org/html/rfc2822#section-3.2.1), which is handled in the [_parseaddr](https://github.com/python/cpython/blob/master/Lib/email/_parseaddr.py#L219) file.

The above combined with the fact that any [failed parsing returns an two-tuple of ('', '')](https://github.com/python/cpython/blob/master/Lib/email/utils.py#L212) I believe explains the behavior observed.

----------
nosy: +trrhodes

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42787>
_______________________________________


More information about the Python-bugs-list mailing list