[issue1409460] email.Utils.parseaddr() gives arcane result
report at bugs.python.org
Sat Jul 17 16:07:24 CEST 2010
Mark Sapiro <mark at msapiro.net> added the comment:
> parsing 'merwok'
> expected ('merwok', '')
> got ('', 'merwok')
I think ('', 'merwok') is the correct result. I think most if not all MUAs/MTAs will interpret an address without an '@', albeit invalid, as a local-part in the local domain, thus parsing 'merwok' as the address 'merwok' with no real name is probably the right thing to do with this input. The alternative would be to return ('', '') indicating failure.
> parsing 'merwok wok at rusty'
> expected ('', 'wok at rusty')
> got ('', 'merwokwok at rusty')
Here, I think failure is a more appropriate return.
In any case, I think this is a new bug deserving of a new report. It is not really relevant to this issue which has to do with nested parentheses.
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list