[python-win32] replacing CreateProcess command for Vista compatibility?
Kirk Vander Meulen
kvander11 at gmail.com
Thu Jan 10 21:07:26 CET 2008
Hi, I'm running the program Pymol (written in python) on Windows Vista, and
in trying to run one of its plugins, I em encountering the following error:
Error: 3
WindowsError Exception in Tk callback
Function: <function <lambda> at 0x027C6DF0> (type: <type 'function'>)
Args: ()
Traceback (innermost last):
File "C:\Program
Files\DeLanoScientific\PyMOL/modules\Pmw\Pmw_1_2\lib\PmwBase.py",
line 1747, in __call__
return apply( self.func, args)
File "C:\Program
Files\DeLanoScientific\PyMOL/modules\Pmw\Pmw_1_2\lib\PmwDialog.py", line
153, in <lambda>
command=lambda self=self, name=name: self._doCommand(name))
File "C:\Program
Files\DeLanoScientific\PyMOL/modules\Pmw\Pmw_1_2\lib\PmwDialog.py", line
132, in _doCommand
return command(name)
File "C:\Program
Files\DeLanoScientific\PyMOL/modules\pmg_tk\startup\apbs_tools.py", line
1136, in execute
good = self.generatePdb2pqrPqrFile()
File "C:\Program
Files\DeLanoScientific\PyMOL/modules\pmg_tk\startup\apbs_tools.py", line
1683, in generatePdb2pqrPqrFile
(retval,progout) = run(self.pdb2pqr.getvalue(),args)
File "C:\Program
Files\DeLanoScientific\PyMOL/modules\pmg_tk\startup\apbs_tools.py", line
362, in run
retcode = subprocess.call(args,stdout=output_file.fileno(),stderr=
subprocess.STDOUT)
File "C:\Program Files\DeLanoScientific\PyMOL\py24\lib\subprocess.py",
line 413, in call
return Popen(*args, **kwargs).wait()
File "C:\Program Files\DeLanoScientific\PyMOL\py24\lib\subprocess.py",
line 543, in __init__
errread, errwrite)
File "C:\Program Files\DeLanoScientific\PyMOL\py24\lib\subprocess.py",
line 706, in _execute_child
startupinfo)
WindowsError: [Errno 193] %1 is not a valid Win32 application
Probably not all of that is relevant, but I thought I'd at least lay it out
there in case there's something obvious there. In doing crazy amounts of
googling, I *think* the problem is that the python file uses a command
called "createprocess()", and, while this may work ok in XP, it does not in
Vista (something to do with how the security setup has changed). The
software is not guaranteed fully Vista-proof, so it seems like a possible
explantion.
So I'm hoping, although not very optimistically, that I can tweak this
command and regain compatibility with Vista. One site I found suggests
using either "ShellExecute()" or "ShellExecuteEx()" in lieu of
"createprocess()". Would this be a simple fix- how much would I have to
change? Here is the relevant call:
hp, ht, pid, tid = CreateProcess(executable, args,
# no special security
None, None,
# must inherit handles to pass std
# handles
1,
creationflags,
env,
cwd,
startupinfo)
Thanks for any help,
Kirk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-win32/attachments/20080110/5951c2f8/attachment-0001.htm
More information about the python-win32
mailing list