spawnv throws exception under Windows XP

Chris Reuter cgreuter at
Tue May 16 17:30:48 CEST 2006

I've been trying to start a particular external program from Python
using os.spawnv().  This works perfectly under Linux but under
Windows, it first runs the program, then throws an OSError exception
with the tuple (0, 'Error'):

	>>> spawnv(P_WAIT, 'c:/mctools/bin/mc', ['mc'])
	Archelon Tool Driver 3.09 2005/02/16
	No input file was given.
	[correct output snipped]
	Traceback (most recent call last):
	  File "<stdin>", line 1, in ?
	OSError: (0, 'Error')

If I understand the error correctly, the zero is the errno value, so
it's throwing an exception to warn me that the program worked

Running a trivial program that was compiled with the same compiler
(mingw) as "mc" worked fine.

This is Python 2.4.3, the standard Windows binaries at,

Has anyone experienced this problem before?  Does anyone know what's
going on or if there's a workaround?

Thanks in advance,


Chris Reuter                                       
"Fortunately, in my life, I have grown very good at convincing myself that
 horrified looks are actually looks of affection. This makes dates much 
 easier."      --Jeff Vogel, <20020806173519.11834.00002748 at>

More information about the Python-list mailing list