[Python-bugs-list] [ python-Bugs-437475 ] MacPy21: sre "recursion limit" bug
noreply@sourceforge.net
noreply@sourceforge.net
Fri, 29 Jun 2001 14:55:39 -0700
Bugs item #437475, was opened at 2001-06-29 14:55
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=437475&group_id=5470
Category: Regular Expressions
Group: Platform-specific
Status: Open
Resolution: None
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: MacPy21: sre "recursion limit" bug
Initial Comment:
As of Python 2.0, the sre module had bug wherein a
"RuntimeError: maximum recursion limit exceeded" would
be raised whenever an expression matched something on
the order of 16,000+ characters. The bug, nominally fixed
in time for Python 2.1, is still present in MacPython 2.1, as
evidenced by the following transcript copied from an
interactive session with the interpreter. Note success with
pre module, however.
It makes me curious, since the bug appears to be fixed in
WinPython 2.1, whether the correct source was used
when compiling MacPython 2.1....
==========
Python 2.1 (#92, Apr 24 2001, 23:59:23) [CW PPC GUSI2
THREADS] on mac
>>> import sre, pre, string
>>> l = ["XXX", "%"*20000, "XXX"]
>>> sre_regex = sre.compile(r"XXX.*?XXX")
>>> match_object = sre_regex.search(string.join(l))
Traceback (most recent call last):
File "<stdin>", line 1, in ?
RuntimeError: maximum recursion limit exceeded
>>> ### Above error first reported upon release of sre
with Python 2.0 ###
>>> ### Bug supposedly fixed in Python 2.0.1 release (no
Mac version, I know) ###
>>> pre_regex = pre.compile(r"XXX.*XXX")
>>> match_object = pre_regex.search(string.join(l))
>>> match_object
<pre.MatchObject instance at 0x04619c90>
>>> ### Note above success with pre module instead of sre
###
>>> ### Wrong sre module source used when compiling
MacPython 2.1? ###
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=437475&group_id=5470