A Python bug? (core dump)

Jeff Blaine jblaine at shell2.shore.net
Fri Jan 14 11:08:08 EST 2000


It doesn't coredump under our build of Python 1.5.2 (or 1.5.1) for Solaris
7.  I eventually get RuntimeError: Maximum recursion depth exceeded

On 13 Jan 2000 17:52:52 -0600, Huaiyu Zhu <huaiyu_zhu at moon.localdomain> wrote:
>The following script dumps core when the "print self" line is uncommented,
>because print calls __str__ which calls print which calls ...
>
>##################################
>class Item:
>    def __init__(self, item):
>        self._ = item
>	    
>    def __str__(self):
>#       print self
>        return `self._`
>
>print Item ('aaa')
>##################################
>
>For some other recursive calls I tried that do not involve print and
>__str__, the outcomes are sane:
>
>RuntimeError: Maximum recursion depth exceeded
>
>I've read somewhere that "Python never dumps core".  So this must be a bug.
>The versions are:
>
>Python 1.5.2 (#1, Sep 17 1999, 20:15:36)  [GCC egcs-2.91.66 19990314/Linux
>(egcs- on linux-i386



More information about the Python-list mailing list