[Python-Dev] Bug in 1.6 and 2.0b1 re?

Thomas Heller thomas.heller@ion-tof.com
Fri, 15 Sep 2000 17:05:22 +0200


[I posted this to the distutils mailing list, but have not yet
received an answer]

> This may not be directly related to distutils,
> it may also be a bug in 1.6 and 2.0b1 re implementation.
> 
> 'setup.py sdist' with the current distutils CVS version
> hangs while parsing MANIFEST.in,
> executing the re.sub command in these lines in text_file.py:
> 
>         # collapse internal whitespace (*after* joining lines!)
>         if self.collapse_ws:
>             line = re.sub (r'(\S)\s+(\S)', r'\1 \2', line)
> 
> 
> Has anyone else noticed this, or is something wrong on my side?
> 

[And a similar problem has been posted to c.l.p by vio]

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

Thomas