[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

Vlastimil Brom report at bugs.python.org
Tue Nov 2 12:56:07 CET 2010

Vlastimil Brom <vlastimil.brom at gmail.com> added the comment:

There seems to be a bug in the handling of numbered backreferences in sub() in
I believe, it would be a fairly new regression, as it would be noticed rather soon.
(tested on Python 2.7; winXP)

>>> re.sub("([xy])", "-\\1-", "abxc")
>>> regex.sub("([xy])", "-\\1-", "abxc")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python27\lib\regex.py", line 176, in sub
    return _compile(pattern, flags).sub(repl, string, count, pos, endpos)
  File "C:\Python27\lib\regex.py", line 375, in _compile_replacement
TypeError: 'int' object is not iterable



Python tracker <report at bugs.python.org>

More information about the Python-bugs-list mailing list