Brett Cannon added the comment:

So the first example (in msg31624) crashes because of infinite recursion
with the repr of exceptions::

#7771 0x00065178 in BaseException_repr (self=0x5dc6b8) at
Objects/exceptions.c:128
#7772 0x0001d90c in PyObject_Repr (v=0x5dc6b8) at Objects/object.c:362
#7773 0x0008c180 in tuplerepr (v=0x5dad58) at Objects/tupleobject.c:221

The second one in msg31626 dies because of the str of exceptions::

#3839 0x0001dd88 in PyObject_Str (v=0x5dc6b8) at Objects/object.c:427
#3840 0x00065120 in BaseException_str (self=0x5dc6b8) at
Objects/exceptions.c:110
#3841 0x0001dc0c in _PyObject_Str (v=0x5dc6b8) at Objects/object.c:407

Both fail because BaseException uses the str/repr of its arguments to
construct what string to return.  When it's itself it just goes on
forever trying to get the next object's representation.

The repr issue might be fixed by looking at how lists catch loops in
themselves (don't remember the exact C function).  Either way it is not
really str/repr that is causing the issue but exceptions for not
worrying about possible recursion thanks to using the str/repr of
contained objects.

_____________________________________
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1686386>
_____________________________________
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to