strange error whilst porting to 2.6

Benjamin Peterson benjamin at
Sat Jan 24 02:44:21 CET 2009

Robin Becker <robin <at>> writes:

> python 2.6 indicates this error whilst running a script that works fine 
> under Python 2.5.
> Exception RuntimeError: 'maximum recursion depth exceeded in 
> __subclasscheck__' in <type 'exceptions.AttributeError'> ignored
> I suppose this must be related to some kind of isinstance or issubclass 
> check, but how can I locate the problem if no traceback is shown?

You're code is causing a RuntimeError to be raised some where in a type checking
call. Unfortunately because of old APIs in CPython that are not "allowed" to
fail, CPython cannot continue to raise the exception, so it just prints that
ugly error message and clanks happily along. The best way to avoid this is just
throw away sys.stderr in code that is acting up like this.

More information about the Python-list mailing list