[PyQt] Segfault on exceptions in QNetworkAccessManager::createRequest

Florian Bruhin me at the-compiler.org
Fri Sep 26 05:55:43 BST 2014


* Kovid Goyal <kovid at kovidgoyal.net> [2014-09-26 09:31:48 +0530]:
> On Thu, Sep 25, 2014 at 11:32:47PM +0100, Phil Thompson wrote:
> > I would argue that the alternative of returning an arbitrary QNetworkReply
> > instance (in this case) is worse because it is a bug that would be extremely
> > difficult to detect and isolate. At least with a crash you know where it
> > happened.
> 
> That's what the print is for. If you really want to crash then dont
> segfault, at least use qFatal.

Why a print?

Why not just *raise the exception* so the configured exception handler
gets invoked (for me that is a crash dialog where the user can report
the crash and restart, with their data emergency-saved).

Currently I achieve this by doing something like this:


def createRequest(...):
    try:
        ...
    except:
        logging.exception("Error in createRequest")
        return False


Then I get the exception in my log, and with the "return False" get a
PyQt exception so my crash dialog shows up.

Long story short - I'd really expect 'raise Exception' in that code to
do the same 'return False' does: raise an exception and *somehow*
prevent a segfault.

Florian

-- 
http://www.the-compiler.org | me at the-compiler.org (Mail/XMPP)
             GPG 0xFD55A072 | http://the-compiler.org/pubkey.asc
         I love long mails! | http://email.is-not-s.ms/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20140926/19f6c140/attachment.sig>


More information about the PyQt mailing list