regexp upward compatibility bug ?

Gilles Lenfant glenfant at nospam-bigfoot.com
Thu Jan 29 10:06:55 EST 2004


Hi,

Porting a Zope app from (old) Zope 2.3.3 powered by Python 1.5.2 to a 
newer Zope powered by Python 2.1.3, I found a regexp problem :

This does perfectly the job with Python 1.5.2 but raises an exception 
with Python 2.1.3. I can't see what's wrong when reading the "re" module 
doc.

Any hint welcome

   File "txt2html.py", line 27, in txt2html
     pat = re.compile(r'((ftp|http)://[\w-]+(?:\.[\w-]+)*(?:/[\w-\.?=]*)*)')
   File "/usr/local/lib/python2.1/sre.py", line 90, in compile
     return _compile(pattern, flags)
   File "/usr/local/lib/python2.1/sre.py", line 136, in _compile
     raise error, v # invalid expression
sre_constants.error: bad character range

Many thanks by advance

--
Gilles




More information about the Python-list mailing list