[Python-bugs-list] [ python-Bugs-561047 ] Maximum recursion limit exceeded
noreply@sourceforge.net
noreply@sourceforge.net
Sun, 02 Jun 2002 06:03:53 -0700
Bugs item #561047, was opened at 2002-05-27 07:27
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=561047&group_id=5470
Category: Regular Expressions
Group: None
>Status: Closed
Resolution: None
Priority: 5
Submitted By: Markus Gritsch (markus_gritsch)
Assigned to: Fredrik Lundh (effbot)
Summary: Maximum recursion limit exceeded
Initial Comment:
Hi!
I think I discovered a limitation of the "new" Regular
Expression engine. I
have put together an example which shows the behavior at
http://stud4.tuwien.ac.at/~e9326522/temporary/re_bug_example.zip
(69kB)
When the script is run with Python 1.5.2 by invoking
psmergeNS.py *.ps
everything is fine and it produces a merged output file
containing both
PostScript files.
When using Python 2.x the following Exception is raised:
Traceback (most recent call last):
File "psmergeNS4.py", line 35, in ?
pages = theRE.findall(contents)
RuntimeError: maximum recursion limit exceeded
This behavior is the same with the Linux and the Win32
version of Python.
Markus
----------------------------------------------------------------------
>Comment By: Skip Montanaro (montanaro)
Date: 2002-06-02 08:03
Message:
Logged In: YES
user_id=44345
Saving /F the trouble of closing this, since it's a duplicate of
<http://python.org/sf/493252> and several others. Read the followups
there for ways to avoid/workaround the problem. If you absolutely can't
modify your regular expression to be less abusive of the stack, you can
always
import pre as re
and deal with the long match times you'll encounter instead.
----------------------------------------------------------------------
Comment By: Bastian Kleineidam (calvin)
Date: 2002-05-29 07:05
Message:
Logged In: YES
user_id=9205
I had the same problem, but only when using *? matching
several kB text.
It seems the the *? backtracking function is recursive and
cannot handle several thousand characters...
Greetings
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=561047&group_id=5470