Brett Cannon added the comment:

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__.

----------
assignee: brett.cannon -> georg.brandl
keywords: +patch
status: open -> pending

_____________________________________
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1686386>
_____________________________________

Attachment: infinite_rec_fix.diff
Description: Binary data

_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to