[PyQt] Segfault on exceptions in QNetworkAccessManager::createRequest

Kovid Goyal 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.

Kovid.

-- 
_____________________________________

Dr. Kovid Goyal 
http://www.kovidgoyal.net
http://calibre-ebook.com
_____________________________________
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20140926/556c6a8a/attachment.sig>


More information about the PyQt mailing list