RE bug in Python 2.0b1

vio vmilitaru at sympatico.ca
Sat Sep 16 00:46:50 EDT 2000


Yes, I also noticed that bug on 1.6 (and wasn't sure anymore whether the
problem was with python or with my debian installation ... on an old 486, who
knows).
So, what's the solution here ? Regressing to 1.5.2 ? Since the problem
appears to be only regarding the "\1" and so groups feature, any idea if it
is "kosher" to maybe transplant the 1.5.2 RE module on an 1.6 or 2.0
installation ? I've heard that Python is on its 4th regular expression engine
at present, maybe the evolution is still in flux. Anybody has a workaround
for this bug ?

Regards,
vio


Fredrik Stenberg wrote:

> On Fri, 15 Sep 2000, vio wrote:
>
> > I believe there may be a RE bug in 2.0b1. Consider the following script:
> >
> > #!/usr/bin/env python
> > import re
> > s = "red green blue"
> > m = re.compile(r'green (\w+)', re.IGNORECASE)
> > t = re.subn(m, r'matchedword \1 blah', s)
> > print t
> >
> >
> > When I run this on 1.5.2, I get the following expected output:
> >
> > ('red matchedword blue blah', 1)
> >
> >
> > If I run it on 2.0b1, python basically hangs.
> >
>
> Same problem with python1.6
>
> /fredriks




More information about the Python-list mailing list