[Patches] [ python-Patches-633359 ] Patch for sre bug 610299

noreply@sourceforge.net noreply@sourceforge.net
Mon, 04 Nov 2002 10:28:24 -0800


Patches item #633359, was opened at 2002-11-04 07:48
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=633359&group_id=5470

Category: Library (Lib)
Group: Python 2.2.x
Status: Open
Resolution: None
Priority: 5
Submitted By: Greg Chapman (glchapman)
Assigned to: Nobody/Anonymous (nobody)
Summary: Patch for sre bug 610299

Initial Comment:
Bug report 610299 points out this discrepancy:

>>> re.compile(r'\w{1}', re.U).sub('X', u'hello caf\xe9') 
u'XXXXX XXXX' 
>>> re.compile(r'\w', re.U).sub('X', u'hello caf\xe9') 
u'XXXXX XXX\xe9' 

The problem is in sre_compile.py: the call to 
_compile_charset near the end of _compile_info forgets to 
pass in the flags, so that the info charset is not compiled 
with re.U.  (The info charset is used when searching to find 
the first character at which a match could start; it is not 
generated for patterns beginning with a repeat like '\w{1}'.)

The attached patch changes this call to pass in the flags; it 
is against the 2.2.2 version of sre_compile.py.


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

>Comment By: Greg Chapman (glchapman)
Date: 2002-11-04 09:28

Message:
Logged In: YES 
user_id=86307

Sorry, I though I marked the checkbox (I know I went throught 
the browse button to find the file).  Anyway, here's the file.

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

Comment By: Martin v. L÷wis (loewis)
Date: 2002-11-04 08:43

Message:
Logged In: YES 
user_id=21627

There's no uploaded file!  You have to check the
checkbox labeled "Check to Upload & Attach File"
when you upload a file.

Please try again.

(This is a SourceForge annoyance that we can do
nothing about. :-( )

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

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