-
Notifications
You must be signed in to change notification settings - Fork 89
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
exception after closing the window #459
Comments
Did you figure out what caused this? I'm just using Python to plot things with Matplotlib and I noticed that when I closed the window, I got the same error. I suspect it is some update in the QT library? It has only started happening after I updated. Thanks! |
I have no idea but I do think it's related to the graphical backend. |
I can reproduce the problem. It's not a "crash", just an exception. You can reproduce it interactively with: using PyPlot
matplotlib."interactive"(false)
plot([2,4], [3,8])
show() which throws the error after closing the window. Interestingly, if you call the |
The exception is triggered by this line in the qt5 backend, and I can reproduce it as follows:
The problem seems to be that Meanwhile, we can probably work around it by setting the handler to let signal = PyPlot.PyCall.pyimport("signal")
signal."signal"(signal."SIGINT", signal."SIG_DFL")
end but I'm not sure if that's the correct behavior in general… the interaction of Python signal handling with Julia signal handling is a little murky. |
Basically, the problem is that Julia installs its own #include <Python.h>
#include <signal.h>
#include <stdio.h>
void myhandler(int sig) { printf("got signal %d\n", sig); }
int main(void)
{
signal(SIGINT, myhandler);
Py_InitializeEx(0);
PyRun_SimpleString("import signal\n"
"old_signal = signal.getsignal(signal.SIGINT)\n"
"signal.signal(signal.SIGINT, old_signal)\n"
"print(old_signal)\n");
Py_Finalize();
return 0;
} This will make it difficult to use PyCall with any module that tries to muck with the signal handlers. Several things that could be done here:
|
Should be fixed in matplotlib 3.1.3 (the next release). |
The script is like this:
and then I run the script in a terminal.
It shows a window displaying the plot. Everything is fine until the window is closed.
The error message is the following:
My julia version is 1.2.0.
The text was updated successfully, but these errors were encountered: