[PyQt] QtCore.QProcess.start insists on having a QStringList as second argument on Windows XP

solsTiCe d'Hiver solstice.dhiver at gmail.com
Fri Dec 24 21:10:48 GMT 2010


hi.
I am using a QProcess with a list as second argument with the start
function. It was never a problem before with python 2.6 and qt 4.6.1 and
the corresponding pyqt.

I use python 2.7.1 on linux (compiled from source-archlinux build) and
pyqt 4.8.2 and qt 4.7.1
I use python 2.7.1 in Windows XP SP3, pyqt 4.8.2 from
PyQt-Py2.7-x86-gpl-4.8.2-1.exe

Now that I retest my app, i see no problem on linux but on windows XP
there is a problem

my code is:
p = QtCore.QProcess(self)
p.start(CMD, [a list of args])

in windows console:

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

X:\>c:\Python27\python.exe m.py
Traceback (most recent call last):
  File m.py", line 300, in updateLabel
    self.pronounceit(t)
  File "m.py", line 225, in pronounceit
    p.start(ESPEAK_CMD, ['-v', ESPEAK_LANG, '-s',  '%d' %
ESPEAK_SPEED,'-w', self.tmpwav, '--', s])
TypeError: arguments did not match any overloaded call:
  QProcess.start(QString, QStringList, QIODevice.OpenMode
mode=QIODevice.ReadWri
te): argument 2 has unexpected type 'list'
  QProcess.start(QString, QIODevice.OpenMode mode=QIODevice.ReadWrite):
argument
 2 has unexpected type 'list'

if I try with QtCore.QStringList(QtCore.QString('...')) it does work
(even on linux) and I don't know why because I got no error.

if I try with QtCore.QStringList([my list]), i got an error on windows:

TypeError: arguments did not match any overloaded call:
  QStringList(): too many arguments
  QStringList(QString): argument 1 has unexpected type 'list'
  QStringList(QStringList): argument 1 has unexpected type 'list'

but this works on linux !!!

I don't know what to do to make it work in Windows. Everything fails. 

Please, please work out those discrepancies between Linux and Windows.





More information about the PyQt mailing list