Message246390
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. |
|
Date |
User |
Action |
Args |
2015-07-07 01:25:42 | dhaffey | set | recipients:
+ dhaffey, ezio.melotti, mrabarnett |
2015-07-07 01:25:41 | dhaffey | set | messageid: <1436232341.94.0.272846345594.issue24580@psf.upfronthosting.co.za> |
2015-07-07 01:25:41 | dhaffey | link | issue24580 messages |
2015-07-07 01:25:41 | dhaffey | create | |
|