Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OrderedDict ref cycles break repr() #54035

Closed
jek mannequin opened this issue Sep 10, 2010 · 3 comments
Closed

OrderedDict ref cycles break repr() #54035

jek mannequin opened this issue Sep 10, 2010 · 3 comments
Assignees
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@jek
Copy link
Mannequin

jek mannequin commented Sep 10, 2010

BPO 9826
Nosy @rhettinger, @merwok
Files
  • odictcyclerepr.py
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/rhettinger'
    closed_at = <Date 2010-09-12.05:29:18.968>
    created_at = <Date 2010-09-10.19:09:59.514>
    labels = ['type-bug', 'library']
    title = 'OrderedDict ref cycles break repr()'
    updated_at = <Date 2010-09-12.05:29:18.966>
    user = 'https://bugs.python.org/jek'

    bugs.python.org fields:

    activity = <Date 2010-09-12.05:29:18.966>
    actor = 'rhettinger'
    assignee = 'rhettinger'
    closed = True
    closed_date = <Date 2010-09-12.05:29:18.968>
    closer = 'rhettinger'
    components = ['Library (Lib)']
    creation = <Date 2010-09-10.19:09:59.514>
    creator = 'jek'
    dependencies = []
    files = ['18835']
    hgrepos = []
    issue_num = 9826
    keywords = []
    message_count = 3.0
    messages = ['116037', '116038', '116150']
    nosy_count = 3.0
    nosy_names = ['rhettinger', 'jek', 'eric.araujo']
    pr_nums = []
    priority = 'low'
    resolution = 'fixed'
    stage = 'needs patch'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue9826'
    versions = ['Python 3.1', 'Python 2.7', 'Python 3.2']

    @jek
    Copy link
    Mannequin Author

    jek mannequin commented Sep 10, 2010

    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__

    @jek jek mannequin added stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Sep 10, 2010
    @rhettinger rhettinger self-assigned this Sep 10, 2010
    @rhettinger
    Copy link
    Contributor

    rhettinger commented Sep 10, 2010

    Patch?

    @rhettinger
    Copy link
    Contributor

    rhettinger commented Sep 12, 2010

    Fixed in r84728 and r84729.
    Will backport to 2.7 shortly.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant