[issue34155] email.utils.parseaddr mistakenly parse an email

Cyril Nicodème report at bugs.python.org
Wed Jul 3 03:17:23 EDT 2019


Cyril Nicodème <contact at cnicodeme.com> added the comment:

This thread has been really interesting to follow, I'm glad to have opened it :)

I would agree with Barry here, it should follow the documentation.

BUT, I would suggest to add a "strict" parameter that would throw exceptions depending on the parsing issue (missing a @, having multiple @, etc).

That way, a basic usage would return the empty strings, letting the developer know the email is invalid, and advanced case would still be possible.

By default, I think having strict set to False would be logical, since it would follow the documentation.

----------

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


More information about the Python-bugs-list mailing list