The stop execution button (red square) doesn't always stop execution (looped try statements)
See original GitHub issueDescription of your problem
What steps will reproduce the problem?
- run this code:
import time
for i in range(0,100):
try:
time.sleep(5)
print('hey %d'%i)
except:
pass
- try stopping it with the red square stop execution button
What is the expected output? What do you see instead? The program stops. What actually happens is that it tries to stop once, the except part of the try statement is triggered and the script continues. But now the stop execution button is greyed out and unusable
Suggested Changes The stop execution script should loop and continuously try until some confirmation is given that the script has stopped. The red square button shouldn’t become greyed out and unusable until the script has actually stopped
Versions and main components
- Spyder Version: 3.1.4
- Python Version: 2.7.13 64 bit
- Qt Version: Qt 5.6.2
- PyQt Version: PyQt5 5.6
- Operating system: Ubuntu 16.04 LTS
Dependencies
Please go to the menu entry Help > Optional Dependencies (or
Help > Dependencies), press the button Copy to clipboard
and paste the contents below:
jedi >=0.9.0 : 0.9.0 (OK)
matplotlib >=1.0 : 2.0.2 (OK)
nbconvert >=4.0 : 5.1.1 (OK)
numpy >=1.7 : 1.12.1 (OK)
pandas >=0.13.1 : 0.20.2 (OK)
pep8 >=0.6 : 1.7.0 (OK)
psutil >=0.3 : 5.2.1 (OK)
pyflakes >=0.5.0 : 1.5.0 (OK)
pygments >=2.0 : 2.2.0 (OK)
pylint >=0.25 : 1.6.5 (OK)
qtconsole >=4.2.0: 4.3.0 (OK)
rope >=0.9.4 : 0.10.5 (OK)
sphinx >=0.6.6 : 1.6.1 (OK)
sympy >=0.7.3 : 1.0 (OK)
Issue Analytics
- State:
- Created 6 years ago
- Comments:29 (10 by maintainers)

Top Related StackOverflow Question
also had this problem w/out catching any exceptions (spyder 4.2.1).
wanted to mention that you can do a hard stop beyond ‘red button’ like this:
Shortcut to this is Ctrl+.
hope that helps.
Hi @opendatasurgeon , I think you are running into another issue then. Could you try to update spyder, and if the problem persists, oppening a new issue with a reproducible code?