<HTML>
<HEAD>
<TITLE>Re: [PyQt] subprocess.Popen() crash after QApplication()</TITLE>
</HEAD>
<BODY>
<FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>So you are having trouble with PyQt -> Qprocess -> python as well as PyQt -> subprocess?<BR>
<BR>
I guess I get around this somehow with the embedded interpereter, i.e.<BR>
<BR>
C Qapplication -> Python embedded -> PyQt -> Qprocess/subprocess<BR>
<BR>
That is very interesting...<BR>
<BR>
Brian<BR>
<BR>
On 12/3/08 11:36 AM, "denis" <<a href="denisbz@t-online.de">denisbz@t-online.de</a>> wrote:<BR>
<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Thanks Brian,<BR>
<BR>
oddly, the C QApplication -> C QProcess -> python subprocess works<BR>
(mac 10.4.11 ppc, py 2.5.1, Qt 4.4.3, PyQt 4.4.2):<BR>
<BR>
QApplication app( argc, argv );<BR>
qPipe( "| python2.5 crash.py" ); -> QProcess<BR>
# crash.py is just subprocess.Popen( "date" ) as posted<BR>
<BR>
So does C QApplication or C QProcess do the set_SA_RESTART stuff<BR>
in that twistedmatrix ticket, and the pyqt QApp / QProcess not ?<BR>
<BR>
Also import webbrowser is ok on mac,<BR>
20592 2 May 2007<BR>
/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/webbrowser.py<BR>
<BR>
cheers<BR>
-- denis<BR>
<BR>
<BR>
Brian Kelley wrote:<BR>
> It’s actually way more complicated than that and I don’t think it has<BR>
> to do with multiple threads, just with improper signal handling. Just<BR>
> running normal python I can trigger this error by:<BR>
><BR>
> Import webbrowser<BR>
><BR>
> A good write up of the problem as originally discovered is here:<BR>
><BR>
> <a href="http://twistedmatrix.com/trac/ticket/733">http://twistedmatrix.com/trac/ticket/733</a><BR>
><BR>
> I have solved(?) this problem by copying over python 2.6’s subprocess<BR>
> module (and webbrowser.py) and importing them locally. The 2.5 version<BR>
> also appears to work in my embedded python interpreter that runs Qt<BR>
> applications. It has never worked in the standard python interpreter.<BR>
><BR>
> You may think about using QProcess in your python Qt application as<BR>
> opposed to subprocess, I’m thinking about wrapping the subprocess API<BR>
> and using a QProcess underneath the hood so I can easily swap them out.<BR>
><BR>
> Brian Kelley<BR>
><BR>
><BR>
<BR>
</SPAN></FONT></BLOCKQUOTE>
</BODY>
</HTML>