Description
Found this using the example posted in
https://codereview.qt-project.org/#/c/185481/
import sys from PySide2 import QtCore, QtWidgets def onClicked(): noSuchFunction() app = QtWidgets.QApplication(sys.argv) button = QtWidgets.QPushButton("Button") button.clicked.connect(onClicked) button.show() sys.exit(app.exec_())
The issue is that the onClicked callback instantiates a GlobalReceiverV2 object, and when the callback is called, "GlobalReceiverV2::qt_metacall" is invoked, which itself calls "SignalManager::callPythonMetaMethod", which sets a Python error because "noSuchFunction" does not exist.
This error is never handled, and when a new QEvent is processed by the QApplication, the event gets skipped because "QApplicationWrapper::notify" checks if any python error occurred, and returns early.
Effectively this means all further events are never processed, and the application becomes unresponsive.
Now the proper fix for this case is to add python error handling code in "GlobalReceiverV2::qt_metacall".
But it should also be considered to print errors in all the generated wrapper methods like in the beginning of "QApplicationWrapper::notify", so the user at least knows why the application is being unresponsive.
Attachments
Issue Links
- relates to
-
PYSIDE-364 Error freezes UI and does not print traceback to terminal
- Closed