[PyQt] Segfault on exceptions in QNetworkAccessManager::createRequest
kovid at kovidgoyal.net
Fri Sep 26 12:45:26 BST 2014
On Fri, Sep 26, 2014 at 09:45:32AM +0100, Phil Thompson wrote:
> The segfault is in Qt because it is always dereferencing a pointer without
> checking for NULL. The issue is whether PyQt should (in the case of a Python
> exception) return a value that doesn't trigger the segfault - but will be
> "wrong" and possibly cause very difficult to identify behaviour later on the
> in application.
Since you know that Qt is going to segfault, when you return NULL, instead of
returning NULL, call qFatal(). Or print and return None. Either approach
is better than just leaving it up to users of PyQt to debug a
segfault in their applications.
Dr. Kovid Goyal
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 181 bytes
Desc: not available
More information about the PyQt