[PYSIDE-364] Error freezes UI and does not print traceback to terminal Created: 01 Oct '16  Updated: 06 Mar '17  Resolved: 06 Mar '17

Status: Closed
Project: Qt for Python
Component/s: PySide
Affects Version/s: dev
Fix Version/s: dev

Type: Bug Priority: P2: Important
Reporter: Fredrik Averpil Assignee: Alexandru Croitor
Resolution: Done Votes: 4
Labels: harder
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Relates
is related to PYSIDE-478 QEvents stop getting processed when a... Open
is related to PYSIDE-360 Missing python error handling in Sign... Closed
Commits: 5c2d3e42ec548f66a8fe9ce2d53b7aa452be82b6

 Description   

Consider the following code:

import sys
from PySide2 import QtWidgets

def on_pressed():
    priknt("world")  # misspelled


app = QtWidgets.QApplication(sys.argv)
button = QtWidgets.QPushButton("Hello")
button.pressed.connect(on_pressed)
button.show()
app.exec_()

When I hit the button, there's an error since the function "priknt" doesn't exist.

  • With PySide2, the UI will freeze up and not generate a traceback in the terminal
  • With PyQt5, the UI will crash instantly and generate a traceback in the terminal
  • With PySide and PyQt4, the UI will keep being functional and generate a traceback in the terminal

Would it be possible to achieve the same functionality as seen in PySide/PyQt4 where the UI doesn't freeze or crash instantly?

My motivation behind this is I really prefer "nothing happens when I click the button!" instead of "aaaw f@ยข$, I lost all my work!".



 Comments   
Comment by Christian Tismer [ 13 Feb '17 ]

At the time of writing (2017-02-13), PySide2 does generate a traceback in the terminal,
but only after you hit Quit in the python app.

I think we should restore the PySide/Qt4 behaviour, and it should not be hard.

Comment by Alberto Soto [ 20 Feb '17 ]

Might this be the same issue described in
https://bugreports.qt.io/browse/PYSIDE-478 ?

Comment by Alexandru Croitor [ 20 Feb '17 ]

Yes, the issue is the same.
I linked them as duplicates, but haven't closed any of them, because both provide separate insight in the issue summaries.

Generated at Sat Nov 17 06:29:50 UTC 2018 using Jira 7.11.2#711002-sha1:fdc329dee91471a641faabfe39b5ff8c0a5b3f66.