[Python-bugs-list] [Bug #115903] sre: split exceeds recursion limit
noreply@sourceforge.net
noreply@sourceforge.net
Sun, 14 Jan 2001 15:59:05 -0800
Bug #115903, was updated on 2000-Oct-03 04:45
Here is a current snapshot of the bug.
Project: Python
Category: Regular Expressions
Status: Closed
Resolution: Fixed
Bug Group: None
Priority: 6
Submitted by: dundacek
Assigned to : effbot
Summary: sre: split exceeds recursion limit
Details: Python 1.6 (#2, Sep 6 2000, 18:20:07) [C] on osf1V4
>>> import sre
>>> import pre
>>> txt=open("file").read()
>>> patt1=sre.compile('a.*?bb', sre.DOTALL)
>>> patt2=pre.compile('a.*?bb', pre.DOTALL)
>>> patt1.split(txt) # ERROR
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/local/lib/python1.6/sre.py", line 146, in _split
m = c.search()
RuntimeError: maximum recursion limit exceeded
>>> patt2.split(txt) # OK
['begin\012', '\012end\012']
where file content is:
begin
atttttttb
atttttttb
...
atttttttb
atttttttb
atttttttbb
end
If string "atttttttb" is repeated more than 1000 times
sre ends with RuntimeError.
If "attttttt" or "atttttttbb" are used instead of
"atttttttb" lines, there is no problem.
Follow-Ups:
Date: 2001-Jan-14 15:59
By: effbot
Comment:
same as 115696
-------------------------------------------------------
For detailed info, follow this link:
http://sourceforge.net/bugs/?func=detailbug&bug_id=115903&group_id=5470