[PyQt] Exceptions in Python Implementations of Virtuals

Phil Thompson phil at riverbankcomputing.com
Tue Sep 30 18:38:25 BST 2014

On 30/09/2014 6:26 pm, Kovid Goyal wrote:
> Aborting on all unhandled exceptions in python callbacks will be a huge
> behavior change. I dont think it is one you can make lightly. Certainly
> not in a minor release.

Agreed - it would be in PyQt v5.4 (if at all).

> My original proposal for using qFatal() is simply in cases where you
> already *know* that Qt will segfault because of the unhandled 
> exception.
> In such cases, qFatal() with an informative error is much nicer.
> Regarding the general question of what to do with exceptions in python
> callbacks, I think it should be left upto the application developer. 
> One
> possible mechanism would be to store the exceptions in a global 
> variable
> (say limited to the last 100 exceptions) and let the application
> developer deal with them as he thinks appropriate.


More information about the PyQt mailing list