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 dhaffey
Recipients dhaffey, ezio.melotti, mrabarnett
Date 2015-07-07.01:25:41
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1436232341.94.0.272846345594.issue24580@psf.upfronthosting.co.za>
In-reply-to
Content
Error reporting for recursive backreferences in regexes isn't consistent across both types of backref. Here's the exception for a recursive numeric backref:

>>> import re
>>> re.compile(r'(\1)')
Traceback (most recent call last):
    ...
sre_constants.error: cannot refer to an open group at position 1

Here's what I'm seeing on the 3.5 branch for a named backref:

>>> re.compile(r'(?P<spam>(?P=spam))')
Traceback (most recent call last):
    ...
RecursionError: maximum recursion depth exceeded

Which is an improvement over 3.4 and below, where compilation succeeds and appears to treat (?P=spam) as valid but unmatchable.
History
Date User Action Args
2015-07-07 01:25:42dhaffeysetrecipients: + dhaffey, ezio.melotti, mrabarnett
2015-07-07 01:25:41dhaffeysetmessageid: <1436232341.94.0.272846345594.issue24580@psf.upfronthosting.co.za>
2015-07-07 01:25:41dhaffeylinkissue24580 messages
2015-07-07 01:25:41dhaffeycreate