[PyQt] Segfault on exceptions in QNetworkAccessManager::createRequest

Florian Bruhin me at the-compiler.org
Fri Sep 26 13:06:37 BST 2014


* Kovid Goyal <kovid at kovidgoyal.net> [2014-09-26 11:01:20 +0530]:
> On Fri, Sep 26, 2014 at 06:55:43AM +0200, Florian Bruhin wrote:
> > 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).
> 
> Because most projects dont have a native exception handler. And note
> that this cannot be a python exception, since control at the end of the
> function returns to native code, not the python VM. 
> 
> The correct solution is for application developers to add exception
> handling in their implementation in python. The discussion here is about
> the best way to prompt them to do that. 
> 
> IMO a segfault is hostile and harder to debug. A print and return False 
> or qFatal() is much easier than a segfault.

Hmm, true. In my application I have a 500ms QTimer which gives control
to the python VM briefly so exceptions are handled.

Though that makes me wonder if there is a way for PyQt to call qFatal
on Python exceptions if the user doesn't handle exceptions any other
way, so by default exceptions would terminate the application?

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/a06d2154/attachment.sig>


More information about the PyQt mailing list