Message253309
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 |
|
Date |
User |
Action |
Args |
2015-10-21 19:17:18 | abacabadabacaba | set | recipients:
+ abacabadabacaba |
2015-10-21 19:17:18 | abacabadabacaba | set | messageid: <1445455038.6.0.824380060049.issue25455@psf.upfronthosting.co.za> |
2015-10-21 19:17:18 | abacabadabacaba | link | issue25455 messages |
2015-10-21 19:17:18 | abacabadabacaba | create | |
|