This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: fixed handling of nested comments in mail addresses
Type: Stage:
Components: Library (Lib) Versions: Python 2.4
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: barry Nosy List: barry, nnorwitz, wamcvey
Priority: normal Keywords: patch

Created on 2006-04-05 06:35 by wamcvey, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
getaddresses-nested-comment-patch wamcvey, 2006-04-05 06:36 patch to fix bug and add testcase for embedded comment in email address bug
getaddresses-nested-comment-rfc822-patch wamcvey, 2006-04-05 19:46 patch to fix bug and add testcase for rfc822.py module
Messages (6)
msg49967 - (view) Author: William McVey (wamcvey) Date: 2006-04-05 06:35
RFC 2822 allows for comments to include other comments
in a mail address. email.Utils.getaddresses() handled
addresses with a comment, but incorrectly advanced the
parsing index twice after a comment finished. This
would cause the outer closing paren in an address like:
    Foo ((FOO Rocks)) <foo@bar.com>
to be missed, and treating the rest of the line as part
of the outer comment.

This patch fixes the bug and adds a testcase to look
for the bug.
msg49968 - (view) Author: William McVey (wamcvey) Date: 2006-04-05 06:38
Logged In: YES 
user_id=25956

hmm, didn't seem to attach my patch the first time. Let's
try adding it again.
msg49969 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2006-04-05 06:46
Logged In: YES 
user_id=33168

Barry, has the new email addressed this?
msg49970 - (view) Author: William McVey (wamcvey) Date: 2006-04-05 19:46
Logged In: YES 
user_id=25956

I just realized that I only submitted the patch for the
email package and that the same bug exists in the rfc822.py
package. Even though deprecated, I imagine bug fixes are
still appropriate, so I'm attaching a second attachment
which patch rfc822.py and adds a testcase for this condition
to test/test_rfc822.py. I also noticed that the testcase
driver in test_rfc822.py emitted a print statement error but
didn't raise a condition when the parsed name or address
differed from the expected name. I've adjusted the driver to
use assertions so that the error condition are more
noticeable (e.g. error status codes).
msg49971 - (view) Author: William McVey (wamcvey) Date: 2006-04-05 19:51
Logged In: YES 
user_id=25956

I see now that there appears to be duplicate patches against
the email package attached. I'll go ahead and remove the
duplicate, leaving one patch for email package and one patch
for rfc822.py. 

Oh, and it probably goes without saying, but the first patch
is relative to the 'email' package directory and the second
is relative to the Lib directory in which rfc822.py is located.
msg49972 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2006-04-30 21:27
Logged In: YES 
user_id=12800

Applied to Python 2.4 for email 3.0 in r45829.  This needs
to be back ported to Python 2.3 for email 2.5 and forward
ported to Python 2.5 for email 4.0.
History
Date User Action Args
2022-04-11 14:56:16adminsetgithub: 43161
2009-03-20 23:51:04ajaksu2linkissue1409460 dependencies
2006-04-05 06:35:58wamcveycreate