This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author brett.cannon
Recipients brett.cannon, georg.brandl, ludvig.ericson, therve
Date 2007-09-12.19:52:04
SpamBayes Score 0.01640998
Marked as misclassified No
Message-id <1189626724.93.0.612583854351.issue1686386@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2007-09-12 19:52:05brett.cannonsetspambayes_score: 0.01641 -> 0.01640998
recipients: + brett.cannon, georg.brandl, therve, ludvig.ericson
2007-09-12 19:52:04brett.cannonsetspambayes_score: 0.01641 -> 0.01641
messageid: <1189626724.93.0.612583854351.issue1686386@psf.upfronthosting.co.za>
2007-09-12 19:52:04brett.cannonlinkissue1686386 messages
2007-09-12 19:52:04brett.cannoncreate