[New-bugs-announce] [issue11603] Python crashes or hangs when rebinding __repr__ as __str__

Carl Banks report at bugs.python.org
Fri Mar 18 22:15:17 CET 2011


New submission from Carl Banks <pythondev1 at aerojockey.com>:

The issue was raised by J Peyret on the following c.l.python thread:

http://groups.google.com/group/comp.lang.python/browse_frm/thread/459e5ec433e7dcab?hl=en#

Several posters reported that the following code either hangs or crashes Python (versions 2.7, 2.6, and 3.2, on Windows and Linux) were tested:

-------------
class Foo(object):
    pass

Foo.__repr__ = Foo.__str__

foo = Foo()
print(str(foo))
-------------

----------
components: Interpreter Core
messages: 131364
nosy: aerojockey
priority: normal
severity: normal
status: open
title: Python crashes or hangs when rebinding __repr__ as __str__
type: crash
versions: Python 2.6, Python 2.7, Python 3.2

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11603>
_______________________________________


More information about the New-bugs-announce mailing list