Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

IDLE editor crashes opening a file with million+ character lines #103089

Copy link
Copy link
Open
@AlexWaygood

Description

@AlexWaygood
Issue body actions

Bug report

IDLE crashes if you try to open a .py file with ridiculously long nested dicts in it.

To reproduce

  1. Copy and paste the contents of this file into a .py file: repro.txt
  2. Attempt to open the file with IDLE.

Observed behaviour

The first time I tried doing this, IDLE opened the file, but then immediately crashed. All subsequent times I have tried doing this, Python has hanged on me requesting IDLE to open the file. (I don't know how long it hangs for; I've interrupted it using CTRL-C every time.)

Comments

This is pretty weird code. The reason why it's so weird is that it's partially generated code: it's the result of a codemod by stubdefaulter.

IDLE is far from the only tool that crashes or hangs when encountering this code. This code also causes black, flake8 and mypy to hang indefinitely. VSCode does open the file, and has no performance issues, but it takes a very long time for pyright's analysis of the file to complete in the background when you open the file with VSCode.

Your environment

  • CPython versions tested on:
    • 3.11.2
    • CPython main branch @ 7703def
  • Operating system and architecture: Windows

Metadata

Metadata

Assignees

Labels

stdlibPython modules in the Lib dirPython modules in the Lib dirtopic-IDLEtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Projects

Status

No status
Show more project fields

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.