[issue1050268] rfc822.parseaddr is broken, breaks sendmail call in smtplib
R. David Murray rdmur...@bitdance.com added the comment: Fix committed to py3k in r85179, 3.1 in r85170, and 2.7 in r85181. I modified the unit tests, deleting the ones that were redundant because they were just two different python spellings of the same input string, and adding a comment about the third test case's quoting pattern. -- resolution: - fixed stage: unit test needed - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1050268 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1050268] rfc822.parseaddr is broken, breaks sendmail call in smtplib
R. David Murray rdmur...@bitdance.com added the comment: It does appear as though parseaddr is dropping quoting information from the returned parsed address. Fixing this is likely to create backward compatibility issues, and I'm very curious to know why parseaddr drops the quoting info. Note that I do not observe the change from test\com to test.com, so I'm assuming that was a typo and ignoring that part (or it represents a bug that is already fixed). The weird example is actually consistent with the rest of parseaddr's behavior, if you understand that behavior as turning quoted pairs inside quoted strings into their literal value, but leaving the quotes around the quoted string(s) in place. Consider the example: parseaddr('test test@test.com') If we remove the Python quoting from this input string we have: \\test\\ test@test.com Interpreting this according to RFC rules we have a quoted string \\ containing a quoted pair (\\). The quoted pair resolves to a single \. Then we have the unquoted text test\\ This parseaddr copies literally (I'm not sure if that is strictly RFC compliant, but given that we are supposed to be liberal in what we except it is as reasonable a thing to do as any.) Finally we have another quoted string test So putting those pieces together according to the rules above, we end up with: \test\\ test@test.com which is the observed output once you remove the Python quoting. So, parseaddr is working as designed. The question is, what is the design decision behind resolving the quoted pairs but leaving the quotes? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1050268 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1050268] rfc822.parseaddr is broken, breaks sendmail call in smtplib
R. David Murray rdmur...@bitdance.com added the comment: After working my way through the code I no longer think that parseaddr is working as designed. I think that this is a bug, and that there is a missing call to quote in getaddrspec. Attached is a revised set of unit tests and a fix. The full python test suite passes with this fix in place, but note that initially I made a mistake in the patch and running test_email passed...that is, before the attached tests there were no tests of parseaddr in the email test suite. I don't know if this patch is safe for backport, but I'm inclined that way. It is hard to see how 3rd party code could be compensating for this bug, since it looses quoting information that doesn't appear to be algorithmically recoverable. -- Added file: http://bugs.python.org/file19103/parseaddr_quote.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1050268 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1050268] rfc822.parseaddr is broken, breaks sendmail call in smtplib
Jeffrey Finkelstein jeffrey.finkelst...@gmail.com added the comment: I can confirm this bug. Attached is the test case. -- keywords: +patch nosy: +jfinkels Added file: http://bugs.python.org/file19079/issue1050268.testcase.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1050268 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1050268] rfc822.parseaddr is broken, breaks sendmail call in smtplib
Changes by Mark Lawrence breamore...@yahoo.co.uk: -- versions: +Python 2.7, Python 3.1, Python 3.2 -Python 2.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1050268 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1050268] rfc822.parseaddr is broken, breaks sendmail call in smtplib
Changes by Barry A. Warsaw ba...@python.org: -- assignee: barry - r.david.murray nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1050268 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1050268] rfc822.parseaddr is broken, breaks sendmail call in smtplib
Changes by Daniel Diniz aja...@gmail.com: -- stage: - test needed title: rfc822.parseaddr is broken, breaks sendmail call in smtplib - rfc822.parseaddr is broken, breaks sendmail call in smtplib type: - behavior versions: +Python 2.6 -Python 2.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1050268 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com