PySide2/PyQt5 crashes app on error?

624 views
Skip to first unread message

Fredrik Averpil

unread,
Sep 29, 2016, 4:01:47 AM9/29/16
to python_in...@googlegroups.com
Not sure if it's just me or if this is a thing.

So, I've noticed that with e.g. Maya 2015 (Qt4) and PySide, when my UI hits an error and I get the Traceback in the script editor the UI doesn't crash/disappear. It's still fully functional in Maya as well as when I run the UI in the cmd/terminal (standalone).

However, with Maya 2017 (Qt5) and PySide2, the application still prints the traceback in the script editor but then simply crashes.
If I run the UI in cmd/terminal (standalone) instead, the UI disappears as well.

The error can be e.g. that when I click a pushButton it calls a function which prints "hello". But in this case let's say the function was misspelled so when I click the button a non-existing function is called.  

Is this something you guys have observed as well -- or could it be something specific to my code?

Cheers,
Fredrik

Marcus Ottosson

unread,
Sep 29, 2016, 4:16:49 AM9/29/16
to python_in...@googlegroups.com

I can confirm this on Windows, or at least some odd behavior.

from PySide2 import QtWidgets

def on_pressed():
    priknt("world")

button = QtWidgets.QPushButton("Hello")
button.pressed.connect(on_pressed)
button.show()

For me, when pressing the button, the window with the button in it stalls and doesn’t do or say anything. The GUI is still responsive and works fine.

When I run:

button.close()

The expected exception appears.

# Error: NameError: file <maya console> line 4: global name 'priknt' is not defined #

But the GUI remains.

The next time I call close(), the GUI closes, and all is well.

This is with a fresh copy of Maya 2017 on Windows 10, all settings default.


--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAD%3DwhWM_m%3DrmaUaU%3D4gka1C4q0oH43cqROUgqqV4%2BVRJnB4Hpg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.



--
Marcus Ottosson
konstr...@gmail.com

Fredrik Averpil

unread,
Oct 1, 2016, 9:43:43 AM10/1/16
to python_in...@googlegroups.com
Yes, I see this behavior in both Windows 10 and macOS (Sierra) when using Maya 2017.

So what's new here in Maya 2017 is the UI completely freezes - when compared to Maya 2016 where it is completely functional although it casts an error in the script editor.

This behavior is also the same when running this PySide2 code in the terminal on macOS. But if you're using PyQt5, the UI completely crashes and disappears instantly.

Hm.


To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.



--
Marcus Ottosson
konstr...@gmail.com

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAFRtmODypNPvuVxOjMFg1QFNtKsHgBubdz3d_WX9RhFn3SNb-Q%40mail.gmail.com.

Fredrik Averpil

unread,
Oct 1, 2016, 9:56:54 AM10/1/16
to python_in...@googlegroups.com
So, this definitively seems like some kind of bug to me. I don't want my application to stall indefinitely on end-users ever. I opened a bug report:

Please add your +1's, comments or ideas to the report. I think this is a quite severe issue.

I really prefer "nothing happens when I click the button!" instead of "aaaw f@¢$, I lost all my work!".

Regards,
Fredrik

thejame...@gmail.com

unread,
Sep 1, 2018, 3:23:53 PM9/1/18
to Python Programming for Autodesk Maya
Was this ever resolved? I'm getting the exact issue trying to import any for of pyside2 gui in maya 2017 macos..

Justin Israel

unread,
Sep 1, 2018, 3:28:18 PM9/1/18
to python_in...@googlegroups.com


On Sun, Sep 2, 2018, 7:23 AM <thejame...@gmail.com> wrote:
Was this ever resolved? I'm getting the exact issue trying to import any for of pyside2 gui in maya 2017 macos..

Do you get an error simply importing PySide2 in Maya 2017? Because that wouldn't be the same issue as previously described. 


On Sunday, October 2, 2016 at 2:56:54 AM UTC+13, Fredrik Averpil wrote:
> So, this definitively seems like some kind of bug to me. I don't want my application to stall indefinitely on end-users ever. I opened a bug report:
> https://bugreports.qt.io/browse/PYSIDE-364
>
>
>
> Please add your +1's, comments or ideas to the report. I think this is a quite severe issue.
>
>
> I really prefer "nothing happens when I click the button!" instead of "aaaw f@¢$, I lost all my work!".
>
>
> Regards,
> Fredrik

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.

James Porter

unread,
Sep 1, 2018, 3:32:53 PM9/1/18
to python_in...@googlegroups.com
No. I’m getting an error when ever I try to launch any for of pyside2 guy in Maya.

I can import pyside, qtcore, qtwidgets shiboken2 etc without any problem
You received this message because you are subscribed to a topic in the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python_inside_maya/U26L1o8ncN4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0Jn9uezBU%2BbRzJqYWqYFdCHSf4qTmz94KgmoKe33YC8Q%40mail.gmail.com.

Justin Israel

unread,
Sep 1, 2018, 3:45:27 PM9/1/18
to python_in...@googlegroups.com


On Sun, Sep 2, 2018, 7:32 AM James Porter <thejame...@gmail.com> wrote:
No. I’m getting an error when ever I try to launch any for of pyside2 guy in Maya.

I can import pyside, qtcore, qtwidgets shiboken2 etc without any problem

Again, that sounds like a different problem. What was previously described was the behavior of Qt code that raises exceptions in its logic which are not caught. 

So it is different if you try to launch simply any gui code and it crashes. What error messages are you seeing? 

James Porter

unread,
Sep 1, 2018, 5:49:20 PM9/1/18
to python_in...@googlegroups.com
Fair enough, Justin!

I’ll start a new thread with some detailed info!!

Thanks

James

Alexander Morano

unread,
Sep 17, 2018, 8:23:23 PM9/17/18
to Python Programming for Autodesk Maya
Well, I will bring back the dead, on topic.

I get this, Maya 2018, using PyQt5. 

If there is an "exception" in the window, at any time, I get a silent, immediate crash.

Nothing logged.

Was this ever resolved by anyone (AD, Riverbank, etc....)?

Is this the new behavior to expect with PyQt5 and Maya 2018-> ???

Feels super bad atm.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages