[Python-bugs-list] [Bug #115903] sre: split exceeds recursion limit

noreply@sourceforge.net noreply@sourceforge.net
Tue, 3 Oct 2000 04:45:04 -0700


Bug #115903, was updated on 2000-Oct-03 04:45
Here is a current snapshot of the bug.

Project: Python
Category: Modules
Status: Open
Resolution: None
Bug Group: None
Priority: 5
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.


For detailed info, follow this link:
http://sourceforge.net/bugs/?func=detailbug&bug_id=115903&group_id=5470