[Patches] [ python-Patches-1464708 ] fixed handling of nested comments in mail addresses

SourceForge.net noreply at sourceforge.net
Wed Apr 5 21:51:35 CEST 2006


Patches item #1464708, was opened at 2006-04-05 06:35
Message generated for change (Comment added) made by wamcvey
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1464708&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Library (Lib)
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: William McVey (wamcvey)
Assigned to: Barry A. Warsaw (bwarsaw)
Summary: fixed handling of nested  comments in mail addresses

Initial Comment:
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 at 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.

----------------------------------------------------------------------

>Comment By: William McVey (wamcvey)
Date: 2006-04-05 19:51

Message:
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.

----------------------------------------------------------------------

Comment By: William McVey (wamcvey)
Date: 2006-04-05 19:46

Message:
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).

----------------------------------------------------------------------

Comment By: Neal Norwitz (nnorwitz)
Date: 2006-04-05 06:46

Message:
Logged In: YES 
user_id=33168

Barry, has the new email addressed this?

----------------------------------------------------------------------

Comment By: William McVey (wamcvey)
Date: 2006-04-05 06:38

Message:
Logged In: YES 
user_id=25956

hmm, didn't seem to attach my patch the first time. Let's
try adding it again.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1464708&group_id=5470


More information about the Patches mailing list