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.

Author vbr
Recipients akitada, amaury.forgeotdarc, collinwinter, ezio.melotti, georg.brandl, giampaolo.rodola, gregory.p.smith, jacques, jaylogan, jhalcrow, jimjjewett, loewis, mark, moreati, mrabarnett, nneonneo, pitrou, r.david.murray, rsc, sjmachin, timehorse, vbr
Date 2010-11-02.11:56:04
SpamBayes Score 6.5589147e-06
Marked as misclassified No
Message-id <1288698967.27.0.673022040104.issue2636@psf.upfronthosting.co.za>
In-reply-to
Content
There seems to be a bug in the handling of numbered backreferences in sub() in
issue2636-20101102.zip
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")
'ab-x-c'
>>> 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
    compiled.extend(items)
TypeError: 'int' object is not iterable
>>>

vbr
History
Date User Action Args
2010-11-02 11:56:07vbrsetrecipients: + vbr, loewis, georg.brandl, collinwinter, gregory.p.smith, jimjjewett, sjmachin, amaury.forgeotdarc, pitrou, nneonneo, giampaolo.rodola, rsc, timehorse, mark, ezio.melotti, mrabarnett, jaylogan, akitada, moreati, r.david.murray, jacques, jhalcrow
2010-11-02 11:56:07vbrsetmessageid: <1288698967.27.0.673022040104.issue2636@psf.upfronthosting.co.za>
2010-11-02 11:56:05vbrlinkissue2636 messages
2010-11-02 11:56:04vbrcreate