[Tutor] problem with re reaching maximum recursions

Danny Yoo dyoo@hkn.eecs.berkeley.edu
Thu, 23 Aug 2001 20:31:34 -0700 (PDT)


On Thu, 23 Aug 2001, John Kenyon wrote:

> Hello all,
> 
> 
> Have problem maybe somebody can give me some ideas on. I have a script that
> goes through a bunch of files and strips the comments out of them - it looks
> for '//', checks to see that it is not preceeded by ':' and then grabs to
> the end of the line. A second regex then goes through and looks for other
> forms of comments, i.e., "/**".
> 
> The regex I am having a problem with is as follows: slashComment =
> re.compile('(?<!:)\/\/.*(\n)')
> 
> The problem is that when it hits too large a file (not sure exactly how big)
> it throws a runtime exception -- "maximum recursion limit exceeded."

I do remember hearing about this error message a while back; I believe the
Python implementers fixed this in the more recent versions.  At least, the
comments in the bug-tracking section on sourceforge imply this:

http://sourceforge.net/tracker/?group_id=5470&atid=105470&func=detail&aid=418626

Can you check to see if the same error occurs under Python 2.1.1?  If so,
then this is something we should bring to the attention of the Python
developers.