[issue24580] Wrong or missing exception when compiling regexes with recursive named backreferences

2015-12-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

It is too late for 3.4, and I left 2.7 as is. Reopen issue if you think that it 
is worth to add a warning to 2.7.

--
nosy: +benjamin.peterson
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24580] Wrong or missing exception when compiling regexes with recursive named backreferences

2015-07-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 361d7af9396e by Serhiy Storchaka in branch '3.5':
Issue #24580: Symbolic group references to open group in re patterns now are
https://hg.python.org/cpython/rev/361d7af9396e

New changeset 4d3557500019 by Serhiy Storchaka in branch 'default':
Issue #24580: Symbolic group references to open group in re patterns now are
https://hg.python.org/cpython/rev/4d3557500019

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24580] Wrong or missing exception when compiling regexes with recursive named backreferences

2015-07-07 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

It is questionable if an exception should be raised in older Python versions. 
Here is a patch for 3.4 that just issues a warning.

--
Added file: 
http://bugs.python.org/file39880/re_open_group_symbolic_ref-3.4.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24580] Wrong or missing exception when compiling regexes with recursive named backreferences

2015-07-07 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
versions: +Python 2.7, Python 3.4

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24580] Wrong or missing exception when compiling regexes with recursive named backreferences

2015-07-07 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is a patch that forbids symbolic references to opened groups in 3.5+.

--
keywords: +patch
stage: needs patch -> patch review
Added file: http://bugs.python.org/file39879/re_open_group_symbolic_ref.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24580] Wrong or missing exception when compiling regexes with recursive named backreferences

2015-07-06 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka
nosy: +serhiy.storchaka
stage:  -> needs patch
versions: +Python 3.5, Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24580] Wrong or missing exception when compiling regexes with recursive named backreferences

2015-07-06 Thread Dan Haffey

New submission from Dan Haffey:

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(?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.

--
components: Regular Expressions
messages: 246390
nosy: dhaffey, ezio.melotti, mrabarnett
priority: normal
severity: normal
status: open
title: Wrong or missing exception when compiling regexes with recursive named 
backreferences
type: behavior

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com