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.21:13:17
SpamBayes Score 0.020860126
Marked as misclassified No
Message-id <1189631597.37.0.487531952371.issue1686386@psf.upfronthosting.co.za>
In-reply-to
Content
OK, so I have attached a possible patch.  I found out that
tuple.__repr__ didn't do anything to prevent infinite recursion since
you can't pull it off from Python code.  But obviously C code is another
matter.  =)

Same goes for object.__str__; it didn't think about a type's tp_str
doing something that could lead to an infinite recursion.

Assigning back to Georg to make sure I am not doing something stupid nor
that the approach is to broad by changing _PyObject_Str() and
tuple.__repr__ instead of BaseException itself.

I have not written tests yet as they are rather difficult to do for what
the C code is doing without relying specifically on how exceptions do
their __repr__/__str__.
Files
File name Uploaded
infinite_rec_fix.diff brett.cannon, 2007-09-12.21:13:17
History
Date User Action Args
2007-09-12 21:13:17brett.cannonsetspambayes_score: 0.0208601 -> 0.020860126
recipients: + brett.cannon, georg.brandl, therve, ludvig.ericson
2007-09-12 21:13:17brett.cannonsetspambayes_score: 0.0208601 -> 0.0208601
messageid: <1189631597.37.0.487531952371.issue1686386@psf.upfronthosting.co.za>
2007-09-12 21:13:17brett.cannonlinkissue1686386 messages
2007-09-12 21:13:17brett.cannoncreate