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

collections.deque.__contains__ and .count should hold strong references. #83771

Closed
sweeneyde opened this issue Feb 9, 2020 · 4 comments
Closed
Labels
3.9 only security fixes stdlib Python modules in the Lib dir type-crash A hard crash of the interpreter, possibly with a core dump

Comments

@sweeneyde
Copy link
Member

BPO 39590
Nosy @rhettinger, @sweeneyde
PRs
  • bpo-39590: make deque.__contains__ and deque.count hold strong references #18421
  • [3.8] bpo-39590: make deque.__contains__ and deque.count hold strong references (GH-18421) #18423
  • 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 = None
    closed_at = <Date 2020-02-09.08:17:34.681>
    created_at = <Date 2020-02-09.05:02:53.654>
    labels = ['library', '3.9', 'type-crash']
    title = 'collections.deque.__contains__ and .count should hold strong references.'
    updated_at = <Date 2020-02-09.08:39:39.382>
    user = 'https://github.com/sweeneyde'

    bugs.python.org fields:

    activity = <Date 2020-02-09.08:39:39.382>
    actor = 'rhettinger'
    assignee = 'none'
    closed = True
    closed_date = <Date 2020-02-09.08:17:34.681>
    closer = 'rhettinger'
    components = ['Library (Lib)']
    creation = <Date 2020-02-09.05:02:53.654>
    creator = 'Dennis Sweeney'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 39590
    keywords = ['patch']
    message_count = 4.0
    messages = ['361642', '361644', '361647', '361648']
    nosy_count = 2.0
    nosy_names = ['rhettinger', 'Dennis Sweeney']
    pr_nums = ['18421', '18423']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'crash'
    url = 'https://bugs.python.org/issue39590'
    versions = ['Python 3.9']

    @sweeneyde
    Copy link
    Member Author

    Similar to https://bugs.python.org/issue39453, but with deques:

    Python 3.9.0a3+:

    >>> from collections import deque
    >>> class A:
    ...     def __eq__(self, other):
    ...         L.clear()
    ...         return NotImplemented
    ...
    >>> L = [A(), A(), A()]
    >>> 17 in L
    False
    >>> L = deque([A(), A(), A()])
    >>> 17 in L

    (Crashes with "Unhandled exception thrown: read access violation.")

    @sweeneyde sweeneyde added 3.9 only security fixes stdlib Python modules in the Lib dir type-crash A hard crash of the interpreter, possibly with a core dump labels Feb 9, 2020
    @sweeneyde
    Copy link
    Member Author

    Should there be a similar generic test case in test.seq_test?

    @rhettinger
    Copy link
    Contributor

    New changeset c6dedde by sweeneyde in branch 'master':
    bpo-39590: make deque.__contains__ and deque.count hold strong references (GH-18421)
    c6dedde

    @rhettinger
    Copy link
    Contributor

    New changeset dc56f5f by Miss Islington (bot) in branch '3.8':
    bpo-39590: make deque.__contains__ and deque.count hold strong references (GH-18421) (GH-18423)
    dc56f5f

    @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
    3.9 only security fixes stdlib Python modules in the Lib dir type-crash A hard crash of the interpreter, possibly with a core dump
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants