-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
The external system terminal close after running script if the Python console exits due to an exception #9240
Comments
@jnsebgosselin I guess this is also happening for 3.x? |
Yes, It should do the same thing in 3.x. However, I do not consider the current behavior to be a bug per se, though I think that implementing the change I'm proposing, either as the default or as an additional option, would be a great Ux-usability improvement. |
I think this could go then on the 3.x series @ccordoba12 ?
I would prefer default, I do not see how useful is the current behavior, nor providing an option for that (also it makes it easier to bubble up the change to master :-p) But I would like to hear opinions :-) @spyder-ide/core-developers |
I agree, @goanpeca ; I don't see how immediately closing the terminal window if an error occurs (thus hiding the error, and possibly even that an error occurred at all) would ever be what a user would want or expect. In the worst case, they can spend a second closing it themselves, which is nothing compared to the cost of the alternative in the most likely case. |
@jnsebgosselin could you work on a fix aimed at the 3.x branch? No configuration needed :-) |
Cool, I'll prepare a PR then. |
Issue Report Checklist
conda update spyder
(orpip
, if not using Anaconda)jupyter qtconsole
(if console-related)spyder --reset
Problem Description
Especially when testing code involving PyQt or PySide, I often like to execute my code using an
external system terminal
on Windows with the optionInteract with the Python console after execution
checked.However, very often when an exception is raised during execution, the Python console and the external system terminal both close, so that it is impossible to see the traceback of the error.
Below is a minimal working example I've put together that allow to reproduce this behavior on my system:
What steps reproduce the problem?
Interact with the Python console after execution
Close
buttonCrash
orCrash2
buttonWhat is the expected output? What do you see instead?
When clicking on the
Close
button, the Python console and the terminal do not close and it is indeed possible to interact with the Python console after execution. When either theCrash
orCrash2
button is clicked, the Python console and the external system terminal both close, so that it is impossible to see the traceback of the error.What I have done to go around this behavior on my system is to change the way the external system terminal is started in Windows from (see here) :
to (see https://stackoverflow.com/a/46882828/4481445) :
This prevents the external system terminal from closing when the Python console exit with an error code other than 0. If there is no error though, then the terminal is closed automatically like before.
Versions
The text was updated successfully, but these errors were encountered: