New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Broken pre.subn() (and pre.sub()) #36761
Comments
The functions pre.subn() and pre.sub() are broken in Python 2.2.1 (#1, Jun 13 2002, 12:57:34)
[GCC 2.95.2 19991024 (release)] on sunos5
Type "help", "copyright", "credits" or "license" for
more information.
>>> import re
>>> re.sub('(a)', '\g<1>', 'bab')
'bab'
>>> import pre as re
>>> re.sub('(a)', '\g<1>', 'bab')
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/local/tools/lib/python2.2/pre.py", line
179, in sub
return pattern.sub(repl, string, count)
File "/usr/local/tools/lib/python2.2/pre.py", line
344, in sub
return self.subn(repl, string, count)[0]
File "/usr/local/tools/lib/python2.2/pre.py", line
366, in subn
repl = pcre_expand(_Dummy, repl)
TypeError: 'NoneType' object is not callable The error has also been reproduced on SunOS5.7 with the The error could not be reproduced on SunOS5.6 using NOTE: The example for re.sub() in the Python Library |
Logged In: YES someone who didn't understand the code changed an (as a workaround, change the line after the "pcre_expand" </F> |
Logged In: YES fixed in CVS |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: