[PyQt] subprocess.Popen() crash after QApplication() ?

Denis denisbz at t-online.de
Tue Dec 2 17:43:04 GMT 2008


Folks,
  has anyone else seen this  or is it me ?
Thanks, cheers

from PyQt4 import QtCore, QtGui
import subprocess
import sys

def sh( cmd_args ):
    (lines, err) = subprocess.Popen( cmd_args,
        stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True ) \
        .communicate()  # wait til process ends
    if err:
        print >>sys.stderr, "error:", err
    return lines

#-------------------------------------------------------------------------------
print sh( "date" )
app = QtGui.QApplication( sys.argv )
print sh( "date" )

# Traceback (most recent call last):
#   File "crash.py", line 8, in <module>
#     print sh( "date" )
#   File "/Users/bz/py/bz/openplus.py", line 96, in sh
#     stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True ) \
#   File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/subprocess.py",
line 667
#     return self._communicate(input)
#   File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/subprocess.py",
line 113
#     rlist, wlist, xlist = select.select(read_set, write_set, [])
# select.error: (4, 'Interrupted system call')

# versions: mac 10.4.11 ppc, py 2.5.1, Qt 4.4.3, PyQt 4.4.2



More information about the PyQt mailing list