QtConsole Freeze and Error After calling input() "QTextCursor::setPosition: out of range"
Opened this issue · 0 comments
TheMatt2 commented
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
Originally posted by @TheMatt2 in #607 (comment)