Skip to content

IDLE: infinite print loop hangs and crashes #112938

Closed
@terryjreedy

Description

@terryjreedy

Bug report

Interactively execute while 1: 1 and Python hangs while, on Windows, a steady stream of 1s is printed. In REPL, ^C stops execution with KeyboardInterrupt. In IDLE, ^C has no effect. Same for ^F6, which (at least on Windows) should kill and restart the execution process. On Windows, clicking top menu Shell, in an attempt to access Restart Shell on the dropdown menu, or clicking anywhere else, crashed IDLE and '(Not responding)' is added to the title bar. The Close button is also disabled. This Discourse post shows the eventual crash result.

I suspect that the prints come so fast that the tk event loop is somehow 'jammed'. This might be unfixable, but it might be worth a look. Can prints get lower priority? Behavior is the same in -n (no subprocess) mode, so not because of IPC socket comms. If no fix, this difference from REPL should be documented.

On macOS, the REPL behavior in Terminal is the same. In IDLE, nothing is printed. Instead, I get an immediate twirling colors ball. The only way to quit was to click the dock icon and select Force Quit.

It is possible that this should be a tkinter bug. @chrstphrchvz Any comment from your tk knowledge?

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic-IDLEtype-bugAn unexpected behavior, bug, or error

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions