maximum recursion depth exceeded

Follower follower at iname.com
Tue Mar 4 23:28:00 EST 2003


Mike Romberg <romberg at smaug.fsl.noaa.gov> wrote: 
> Exception exceptions.RuntimeError: 'maximum recursion depth exceeded'
> in  ignored
> 
> But I can't seem to catch the exceptions.  Is there something
> special about this exception?
Yes. Messages of the form "<exception> in <location> ignored" are
caused by exceptions generated in the '__del__()' method of objects.

>From <http://www.python.org/doc/1.4/tut/node113.html> (couldn't find
anything more recent):

"Exceptions in __del__ methods. When a __del__ method raises an
exception, a warning is written to sys.stderr and the exception is
ignored. Formerly, such exceptions were ignored without warning.
(Propagating the exception is not an option since it it is invoked
from an object finalizer, which cannot return any kind of status or
error.)"

You'll note that in your error message that "<location>" is blank,
thus the phrase "in  ignored" (note the two spaces). I assume this is
because the code is in an 'eval()'.

My guess is the problem is being caused when objects you create in the
'eval()' are being deleted. There *is* no way to catch the exception.

Perhaps you could show us your actual code?

--Phil.




More information about the Python-list mailing list