flanker icon indicating copy to clipboard operation
flanker copied to clipboard

validate_address can't handle display name

Open ChrisCPO opened this issue 7 years ago • 1 comments

This looks like a possible bug; address.validate_address returns none when passed a email string with a display name. Yet parse can handle it.

>>> text = 'Fooman <[email protected]>'
>>> address.validate_address(text)
>>> None
>>> address.validate_address('[email protected]')
>>> [email protected]
>>> address.parse('Fooman <[email protected]>')
>>>Fooman <[email protected]>

ChrisCPO avatar Nov 15 '17 01:11 ChrisCPO

I was not the one who originally wrote this, but the docstring states that the method takes addr_spec which i suppose means just email address, no display name. I personally see no problem in making it work on addresses that include display name. So I am tagging that as enhancement. But it is so minor, that I doubt it will ever be implemented unless you wanna venture a PR :)

horkhe avatar Nov 16 '17 11:11 horkhe