classification
Title: OrderedDict ref cycles break repr()
Type: behavior Stage: needs patch
Components: Library (Lib) Versions: Python 3.2, Python 3.1, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: rhettinger Nosy List: eric.araujo, jek, rhettinger
Priority: low Keywords:

Created on 2010-09-10 19:09 by jek, last changed 2010-09-12 05:29 by rhettinger. This issue is now closed.

Files
File name Uploaded Description Edit
odictcyclerepr.py jek, 2010-09-10 19:09
Messages (3)
msg116037 - (view) Author: jason kirtland (jek) Date: 2010-09-10 19:09
repr of circular graphs of collections.OrderedDicts fails with 'RuntimeError: maximum recursion depth exceeded while calling a Python object'.

>>> from collections import OrderedDict
>>> left, right = OrderedDict(), OrderedDict()
>>> left['other'] = right
>>> right['other'] = left
>>> left
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  ...
  File "lib/python2.7/collections.py", line 137, in __repr__
    return '%s(%r)' % (self.__class__.__name__, self.items())
RuntimeError: maximum recursion depth exceeded in __subclasscheck__
msg116038 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2010-09-10 19:34
Patch?
msg116150 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2010-09-12 05:29
Fixed in r84728 and r84729.
Will backport to 2.7 shortly.
History
Date User Action Args
2010-09-12 05:29:18rhettingersetstatus: open -> closed
resolution: fixed
messages: + msg116150
2010-09-11 22:34:57eric.araujosetnosy: + eric.araujo

stage: needs patch
2010-09-10 19:34:58rhettingersetpriority: normal -> low

messages: + msg116038
2010-09-10 19:28:35rhettingersetassignee: rhettinger

nosy: + rhettinger
2010-09-10 19:09:59jekcreate