This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: pre bug
Type: Stage:
Components: Regular Expressions Versions: Python 2.2
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: effbot Nosy List: effbot, hanwen
Priority: normal Keywords:

Created on 2002-09-04 23:20 by hanwen, last changed 2022-04-10 16:05 by admin. This issue is now closed.

Messages (2)
msg12279 - (view) Author: Han-Wen Nienhuys (hanwen) * Date: 2002-09-04 23:20
Hi there, 

I have an annoying bug with python 2.2 -- a workaround
is also appreciated. 

Thanks.


blauw:~/usr/src/lilypond$ cat q.py

import pre

print pre.sub ('(@)', r'@\1', r"\key c \minor r8 c16 b
c8 g as c16 b c8 d | g,4 ")

blauw:~/usr/src/lilypond$ python2 q.py
Traceback (most recent call last):
  File "q.py", line 4, in ?
    print pre.sub ('(@)', r'@\1', r"\key c \minor r8
c16 b c8 g as c16 b c8 d | g,4 ")
  File "/usr/lib/python2.2/pre.py", line 179, in sub
    return pattern.sub(repl, string, count)
  File "/usr/lib/python2.2/pre.py", line 344, in sub
    return self.subn(repl, string, count)[0]
  File "/usr/lib/python2.2/pre.py", line 366, in subn
    repl = pcre_expand(_Dummy, repl)
TypeError: 'NoneType' object is not callable
blauw:~/usr/src/lilypond$ rpm -q python2
python2-2.2-16
msg12280 - (view) Author: Fredrik Lundh (effbot) * (Python committer) Date: 2002-09-09 14:27
Logged In: YES 
user_id=38376

this has been fixed in CVS:

http://cvs.sourceforge.net/cgi-
bin/viewcvs.cgi/python/python/dist/src/Lib/pre.py.diff?
r1=1.10&r2=1.10.18.1
History
Date User Action Args
2022-04-10 16:05:39adminsetgithub: 37136
2002-09-04 23:20:49hanwencreate