Skip to content

QtConsole Freeze and Error After calling input() "QTextCursor::setPosition: out of range" #610

@TheMatt2

Description

@TheMatt2

Issue with QtConsole freezing when using input() to prompt the user for input after printing something asynchronously from a second thread.

It seems to be important that the prompt given to input() is a blank string.

The following code fragment can replicate the issue.

import time, threading

def f():
    time.sleep(2)
    print("Hello")

threading.Thread(target = f).start(); x = input()

When you run the code, you do not get a prompt back, and the console QtConsole was launched from logs the message QTextCursor::setPosition: Position '429' out of range

Jupyter QtConsole 5.6.0.dev0

Tested against commit version: 56e5a5e

image

Originally posted by @TheMatt2 in #607 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions