I'm trying to write a pyqt5 application. It throws an exception from the Python side in a slot (i.e. callback) that responds to the user clicking a button. I run the application with
python -m pdb myapp.py
which begins with
# myapp.py
import sys
from PyQt5.QtCore import pyqtRemoveInputHook
pyqtRemoveInputHook()
from PyQt5.QtWidgets import QApplication, QWidget
from views import MainWindow
app = QApplication(sys.argv)
main_window = MainWindow()
main_window.show()
sys.exit(app.exec_())
as per this question. I get the debugger prompt at program start and press c to continue. But when the crash happens, I get a stack trace and then a core dump. If I run with ipdb the core dump doesn't happen, but the program locks up before it can drop me into the debugger.
It seems like it's impossible to debug pyqt5 programs if the error is in a callback, although this worked fine in pyqt4 if I recall. How can I get a Python debugger working with pyqt5?