-
-
Notifications
You must be signed in to change notification settings - Fork 367
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
Allow interrupting input() on Windows, as part of effort to make pdb interruptible #498
Allow interrupting input() on Windows, as part of effort to make pdb interruptible #498
Conversation
Not sure what's up with failure on Travis, unless I did something wrong I also get them on |
@Carreau @blink1073 any chance someone could look at this? Lack of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking this on!
ipykernel/kernelbase.py
Outdated
# doing a blocking recv() means stdin reads are uninterruptible | ||
# on Windows: | ||
if (ident, reply) == (None, None): | ||
time.sleep(0.001) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wary of spin loops like this; since it is a socket we can use select()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately select()
is also uninterruptible by KeyboardInterrupt on Windows. I decided to try using it anyway, because that way at least the loop will be more responsive while needing to wake up less. But sadly as far as I can tell this needs a loop of some sort if it's going to be uninterruptible 😞
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shucks, thanks for looking into it. I'm not sure what happened on the last travis build, I kicked it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried matplotlib 3.2.1 on my Linux machine and can't reproduce those issues. But on newer version of Python.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IPython 7.14.0 was released 4 days ago, that might be it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might be relevant: https://github.com/ipython/ipython/pull/12184/files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm using same version of matplotlib as Travis, though. With updated ipython still can't reproduce... Can you try rerunning tests on master? At least that way can tell if it's in any way related to this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...and that failed in the same way
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one thing to try is pinning the ipython version to 7.13.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
This is part of the solution to ipython/ipython#10516.