Éric Araujo <[email protected]> added the comment:
I wonder if this bug should be reopened. This behavior does not seem right to
me:
parsing 'merwok'
expected ('merwok', '')
got ('', 'merwok')
parsing 'merwok w...@rusty'
expected ('', 'w...@rusty')
got ('', 'merwok...@rusty')
(Generated with a twenty-line script just doing a loop and prints, not attached
because boring.)
Are my expectations wrong? I don’t know if a string like “merwok” in my first
example is a legal address in the relevant RFCs, nor do I know if the folding
done in the second example is okay.
For background, the thing I’m trying to achieve is to take a string and parse
it into name and email address, and print a warning if there is no email. It’d
be nice if I could always test for “not parseaddr(s)[1]”, or pass an argument
to the function to get an exception. Maybe I’ll have to restrict my format and
do my own parsing with str.[r]partition.
----------
nosy: +merwok, r.david.murray
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue1409460>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com