Bug: Notebook Editor, Interactive Window, Editor cells
Steps to cause the bug to occur
- Open a jupyter notebook
- Run following example code in a cell:
import time
for i in range(0, 100):
try:
print(i)
time.sleep(0.5)
except KeyboardInterrupt:
print('You stopped run i={} early'.format(i))
print('Hit interrupt button again if you want to exit')
time.sleep(0.5)
- Try to interrupt kernel (before loop is finished)
Actual behavior
The above loop finishes although kernel was interrupted. This is a special case which I use for interrupting some loops while not interrupting the full process (therefore the KeyboardInterrupt). However, when I use jupyter notebook I can just call interrupt twice when I want to leave the loop. After calling it once in vscode the button for interruption is greyed out and I see a loading bar on top, can't restart kernel in this case and have to close the notebook and reopen it to restart the kernel.
Expected behavior
It would be nice to have the ability to interrupt the kernel until the kernel is actually interrupted. This is probably only an issue if somebody uses "except KeyboardInterrupt" but if it is possible to fix would be nice. Thanks.
Your Jupyter and/or Python environment
Please provide as much info as you readily know
- Jupyter server running: happens Local & Remote
- Extension version: 2020.2.64397
- VS Code version: 1.43
- Setting python.jediEnabled: false
- Python and/or Anaconda version: Python 3.7.6
- OS: Linux (ubuntu):
- Virtual environment: conda
Bug: Notebook Editor, Interactive Window, Editor cells
Steps to cause the bug to occur
Actual behavior
The above loop finishes although kernel was interrupted. This is a special case which I use for interrupting some loops while not interrupting the full process (therefore the KeyboardInterrupt). However, when I use jupyter notebook I can just call interrupt twice when I want to leave the loop. After calling it once in vscode the button for interruption is greyed out and I see a loading bar on top, can't restart kernel in this case and have to close the notebook and reopen it to restart the kernel.
Expected behavior
It would be nice to have the ability to interrupt the kernel until the kernel is actually interrupted. This is probably only an issue if somebody uses "except KeyboardInterrupt" but if it is possible to fix would be nice. Thanks.
Your Jupyter and/or Python environment
Please provide as much info as you readily know