[Patches] [ python-Patches-663369 ] (email) Escape backslashes in specialsre and escapesre

SourceForge.net noreply@sourceforge.net
Mon, 10 Mar 2003 10:49:32 -0800


Patches item #663369, was opened at 2003-01-06 22:37
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=663369&group_id=5470

Category: Library (Lib)
Group: None
Status: Closed
Resolution: Rejected
Priority: 5
Submitted By: Matthew Woodcraft (mhf)
Assigned to: Barry A. Warsaw (bwarsaw)
Summary: (email) Escape backslashes in specialsre and escapesre

Initial Comment:
(email/Utils.py) Escape backslashes in character
classes in specialsre and escapesre.

Patch against sourceforge CVS as of 2003-01-06
python/dist/src/Lib/email/Utils.py  rev 1.21
python/dist/src/Lib/email/test/test_email.py  rev 1.29


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

>Comment By: Matthew Woodcraft (mhf)
Date: 2003-03-10 18:49

Message:
Logged In: YES 
user_id=57248

The backslashes need to be escaped, not for the Python string
interpreter, but for the regular expression compiler --
backslashes in
character classes need to be doubled in order to stand for
themselves.
Currently, the backslashes in the character classes are
'escaping' the
following open parenthesis characters, and effectively being
ignored.

The change to the testcase is there in order to test for the
bug being
fixed: backslashes in quoted-strings must be escaped (rfc822
3.3 /
rfc2822 3.2.5).


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

Comment By: Barry A. Warsaw (bwarsaw)
Date: 2003-03-10 17:52

Message:
Logged In: YES 
user_id=12800

This patch doesn't look right.  First, we're using raw
strings so we don't need to escape backslashes.  Second, why
did you add backslashes around the word Silly in the test case?


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

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