[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyQt] "Abort Trap: 6" on exception on GUI thread
From:       Patrick Stinson <patrickkidd () gmail ! com>
Date:       2017-02-11 4:05:49
Message-ID: 9DD54645-0703-44F8-A2C2-D6B2E1429E52 () gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Maxwell, thanks for the tip. After reading that it turns out all you have to do is \
use any custom exvepthook and it will prevent the abort call:

def no_abort(a, b, c):
    sys.__excepthook__(a, b, c)
sys.excepthook = no_abort


> On Feb 10, 2017, at 7:57 PM, Maxwell Grady <max.grady@gmail.com> wrote:
> 
> PyQt > 5.5 will always Abort when there is an unhandled exception which in this \
> case is the TypeError as a result of the raise statement. \
> (http://pyqt.sourceforge.net/Docs/PyQt5/incompatibilities.html \
> <http://pyqt.sourceforge.net/Docs/PyQt5/incompatibilities.html>) 
> To my knowledge that behavior can't be turned off with any form of configuration. 
> 
> -Maxwell
> 
> On Fri, Feb 10, 2017 at 10:46 PM, Patrick Stinson <patrickkidd@gmail.com \
> <mailto:patrickkidd@gmail.com>> wrote: Oh yes, and I'm using Qt/PyQt@5.7.1 with \
> python3.5 
> > On Feb 10, 2017, at 7:45 PM, Patrick Stinson <patrickkidd@gmail.com \
> > <mailto:patrickkidd@gmail.com>> wrote: 
> > Hello!
> > 
> > Is there any way to configure PyQt5 not to trigger an abort trap when an \
> > exception is raised in the gui thread? 
> > turin:pkdiagram patrick$ make run
> > Traceback (most recent call last):
> > File "/Users/patrick/Documents/dev/pkdiagram/pkdiagram/scene.py", line 28, in \
> > mousePressEvent raise 'sdsdfsd'
> > TypeError: exceptions must derive from BaseException
> > make: *** [run] Abort trap: 6
> > turin:pkdiagram patrick$ 
> > 
> > 
> > Thank you!
> > -P
> 
> 
> _______________________________________________
> PyQt mailing list    PyQt@riverbankcomputing.com \
> <mailto:PyQt@riverbankcomputing.com> \
> https://www.riverbankcomputing.com/mailman/listinfo/pyqt \
> <https://www.riverbankcomputing.com/mailman/listinfo/pyqt> 
> 
> 
> -- 
> University of New Hampshire
> Department of Physics
> Pohl Group
> DeMeritt Hall 119
> ---
> Síocháin agus Grá


[Attachment #5 (unknown)]

<html><head><meta http-equiv="Content-Type" content="text/html \
charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; \
-webkit-line-break: after-white-space;" class="">Maxwell, thanks for the tip. After \
reading that it turns out all you have to do is use any custom exvepthook and it will \
prevent the abort call:<div class=""><br class=""></div><div class=""><div \
style="margin: 0px; font-size: 15px; line-height: normal; font-family: Monaco; color: \
rgb(225, 225, 225); background-color: rgb(0, 0, 0);" class=""><span \
style="font-variant-ligatures: no-common-ligatures; color: #d03bff" \
class="">def</span><span style="font-variant-ligatures: no-common-ligatures" \
class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: \
#7f7d26" class="">no_abort</span><span style="font-variant-ligatures: \
no-common-ligatures" class="">(a, b, c):</span></div><div style="margin: 0px; \
font-size: 15px; line-height: normal; font-family: Monaco; color: rgb(225, 225, 225); \
background-color: rgb(0, 0, 0);" class=""><span style="font-variant-ligatures: \
no-common-ligatures" class="">&nbsp; &nbsp; sys.__excepthook__(a, b, \
c)</span></div><div style="margin: 0px; font-size: 15px; line-height: normal; \
font-family: Monaco; color: rgb(205, 121, 35); background-color: rgb(0, 0, 0);" \
class=""><span style="font-variant-ligatures: no-common-ligatures" \
class="">sys.excepthook</span><span style="font-variant-ligatures: \
no-common-ligatures; color: #e1e1e1" class=""> =</span><span \
style="font-variant-ligatures: no-common-ligatures; color: #f4f4f4" class=""> \
</span><span style="font-variant-ligatures: no-common-ligatures; color: #e1e1e1" \
class="">no_abort</span></div></div><div class=""><br class=""></div><div \
class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Feb 10, \
2017, at 7:57 PM, Maxwell Grady &lt;<a href="mailto:max.grady@gmail.com" \
class="">max.grady@gmail.com</a>&gt; wrote:</div><br \
class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">PyQt &gt; 5.5 \
will always Abort when there is an unhandled exception which in this case is the \
TypeError as a result of the raise statement. (<a \
href="http://pyqt.sourceforge.net/Docs/PyQt5/incompatibilities.html" \
class="">http://pyqt.sourceforge.net/Docs/PyQt5/incompatibilities.html</a>)<div \
class=""><br class=""></div><div class="">To my knowledge that behavior can't be \
turned off with any form of configuration.&nbsp;</div><div class=""><br \
class=""></div><div class="">-Maxwell</div></div><div class="gmail_extra"><br \
class=""><div class="gmail_quote">On Fri, Feb 10, 2017 at 10:46 PM, Patrick Stinson \
<span dir="ltr" class="">&lt;<a href="mailto:patrickkidd@gmail.com" target="_blank" \
class="">patrickkidd@gmail.com</a>&gt;</span> wrote:<br class=""><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div style="word-wrap:break-word" class="">Oh yes, and I'm \
using Qt/PyQt@5.7.1 with python3.5<div class=""><div class="h5"><div class=""><br \
class=""><div class=""><blockquote type="cite" class=""><div class="">On Feb 10, \
2017, at 7:45 PM, Patrick Stinson &lt;<a href="mailto:patrickkidd@gmail.com" \
target="_blank" class="">patrickkidd@gmail.com</a>&gt; wrote:</div><br \
class="m_2544888005605295039Apple-interchange-newline"><div class=""><div \
style="word-wrap:break-word" class="">Hello!<div class=""><br class=""></div><div \
class="">Is there any way to configure PyQt5 not to trigger an abort trap when an \
exception is raised in the gui thread?</div><div class=""><br class=""></div><div \
class=""><div style="margin:0px;line-height:normal;font-family:Monaco;color:rgb(244,244,244);background-color:rgb(0,0,0)" \
class=""><span style="font-variant-ligatures:no-common-ligatures" \
class="">turin:pkdiagram patrick$ make run</span></div><div \
style="margin:0px;line-height:normal;font-family:Monaco;color:rgb(244,244,244);background-color:rgb(0,0,0)" \
class=""><span style="font-variant-ligatures:no-common-ligatures" class="">Traceback \
(most recent call last):</span></div><div \
style="margin:0px;line-height:normal;font-family:Monaco;color:rgb(244,244,244);background-color:rgb(0,0,0)" \
class=""><span style="font-variant-ligatures:no-common-ligatures" class="">&nbsp; \
File "/Users/patrick/Documents/dev/<wbr class="">pkdiagram/pkdiagram/scene.py", line \
28, in mousePressEvent</span></div><div \
style="margin:0px;line-height:normal;font-family:Monaco;color:rgb(244,244,244);background-color:rgb(0,0,0)" \
class=""><span style="font-variant-ligatures:no-common-ligatures" class="">&nbsp; \
&nbsp; raise 'sdsdfsd'</span></div><div \
style="margin:0px;line-height:normal;font-family:Monaco;color:rgb(244,244,244);background-color:rgb(0,0,0)" \
class=""><span style="font-variant-ligatures:no-common-ligatures" class="">TypeError: \
exceptions must derive from BaseException</span></div><div \
style="margin:0px;line-height:normal;font-family:Monaco;color:rgb(244,244,244);background-color:rgb(0,0,0)" \
class=""><span style="font-variant-ligatures:no-common-ligatures" class="">make: *** \
[run] Abort trap: 6</span></div><div \
style="margin:0px;line-height:normal;font-family:Monaco;color:rgb(244,244,244);background-color:rgb(0,0,0)" \
class=""><span style="font-variant-ligatures:no-common-ligatures" \
class="">turin:pkdiagram patrick$&nbsp;</span></div></div><div class=""><br \
class=""></div><div class=""><br class=""></div><div class="">Thank you!</div><div \
class="">-P</div></div></div></blockquote></div><br \
class=""></div></div></div></div><br class="">______________________________<wbr \
class="">_________________<br class=""> PyQt mailing list&nbsp; &nbsp; <a \
href="mailto:PyQt@riverbankcomputing.com" class="">PyQt@riverbankcomputing.com</a><br \
class=""> <a href="https://www.riverbankcomputing.com/mailman/listinfo/pyqt" \
rel="noreferrer" target="_blank" class="">https://www.<wbr \
class="">riverbankcomputing.com/<wbr class="">mailman/listinfo/pyqt</a><br \
class=""></blockquote></div><br class=""><br clear="all" class=""><div class=""><br \
class=""></div>-- <br class=""><div class="gmail_signature" \
data-smartmail="gmail_signature"><div dir="ltr" class=""><div class="">University of \
New Hampshire</div><div class="">Department of Physics</div><div class="">Pohl \
Group</div><div class="">DeMeritt Hall 119</div><div class="">---</div>Síocháin \
agus Grá</div></div> </div>
</div></blockquote></div><br class=""></div></body></html>


[Attachment #6 (text/plain)]

_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
https://www.riverbankcomputing.com/mailman/listinfo/pyqt

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic