Skip to content

bisect.insort crashes the interpreter if key is a string #92839

Closed

Description

@PaulWGraham

Crash report

The following code will crash the interactive interpreter.

import bisect

x = []
y = {'a': 2 , "b" : 1 }
bisect.insort(x, y, key='b')

Error messages

None. Just dumped back to the command line from the interactive interpreter.

Your environment

  • CPython versions tested on:
    Python 3.10.4 (tags/v3.10.4:9d38120, Mar 23 2022, 23:13:41) [MSC v.1929 64 bit (AMD64)] on win32

  • Operating system and architecture:
    Edition Windows 10 Pro
    Version 21H2
    Installed on ‎7/‎28/‎2021
    OS build 19044.1706
    Experience Windows Feature Experience Pack 120.2212.4170.0

Activity

  1. added
    type-crashA hard crash of the interpreter, possibly with a core dump
    on May 16, 2022
  2. stevendaprano commented on May 16, 2022

    @stevendaprano
    Member

    Verified that there is a segmentation fault on Linux too, using Python 3.10.0.

  3. self-assigned this
    on May 16, 2022
  4. rhettinger commented on May 16, 2022

    @rhettinger
    Contributor

    Confirmed.

  5. added a commit that references this issue on May 28, 2022
  6. added 3 commits that reference this issue on May 28, 2022
  7. added a commit that references this issue on May 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

type-crashA hard crash of the interpreter, possibly with a core dump

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions