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 abacabadabacaba
Recipients abacabadabacaba
Date 2015-10-21.19:17:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1445455038.6.0.824380060049.issue25455@psf.upfronthosting.co.za>
In-reply-to
Content
Implementations of repr for some of the types in the standard library doesn't check for self-referential structures. As a result, when calling repr() on such objects, Python crashes due to infinite recursion.

Example:
>>> import functools
>>> x = functools.partial(min)
>>> x.__setstate__((x, (), {}, {}))
>>> repr(x)
Segmentation fault

Another example:
>>> import xml.etree.ElementTree
>>> x = xml.etree.ElementTree.Element('')
>>> x.tag = x
>>> repr(x)
Segmentation fault

One more example:
>>> import io
>>> class X(io.TextIOWrapper): __slots__ = 'name'
>>> x = X(open('/dev/null'))
>>> x.name = x
>>> repr(x)
Segmentation fault
History
Date User Action Args
2015-10-21 19:17:18abacabadabacabasetrecipients: + abacabadabacaba
2015-10-21 19:17:18abacabadabacabasetmessageid: <1445455038.6.0.824380060049.issue25455@psf.upfronthosting.co.za>
2015-10-21 19:17:18abacabadabacabalinkissue25455 messages
2015-10-21 19:17:18abacabadabacabacreate