New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Input() never returns when InteractiveShellEmbed is used? #12078
Comments
Thanks for the report; that might be due to prompt toolkit hijacking input; there is likely a context manager to get a stdin that works. I know there is |
Hi,
After executing it, IPython hangs. |
When macro input gives timeout the Spock (IPython) gets hung completely. It seems to be bug in IPython - see ipython/ipython#12078. Use prompt_toolkit.prompt() (a dependency of IPython) instead of input() and raise an exception in the thread waiting for input when the timeout was reached. This apparently works. Also change the message in Spock when the timeout is reached.
I'm pretty stuck on this one here...
When I use an instance of InteractiveShellEmbed, if Input() is called from another thread, the program will freeze. Not even CTRL-C can break it!
It seems to be the case that Stdin is somehow bound by the interactiveshell, and so input() never receives any data. Further, attempts to directly get data from Stdin with a readline call fail also. Sometimes, I am able to get characters, but never a newline character.
Is there a way to either,
I am willing to put in the work to fix this if someone can point me in the right direction!
The text was updated successfully, but these errors were encountered: