
Dave Abrahams <dave@boostpro.com> added the comment: New data point: in some contexts on Windows (not sure of the exact cause but I was dealing with multiple drives), even this workaround isn't enough. I ended up having to do something like this (i.e. manually search the path) on win32: def full_executable_path(invoked, environ): if os.path.splitext(invoked)[1]: return invoked explicit_dir = os.path.dirname(invoked) if explicit_dir: path = [ explicit_dir ] else: path = environ.get('PATH').split(os.path.pathsep) extensions = environ.get( 'PATHEXT', # Use *something* in case the environment variable is # empty. These come from my machine's defaults '.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.PSC1' ).split(os.path.pathsep) for dir in path: for ext in extensions: full_path = os.path.join(dir, invoked+ext) if os.path.exists( full_path ): return full_path return invoked # Not found; invoking it will likely fail class Popen(subprocess.Popen): def __init__( self, args, bufsize=0, executable=None, stdin=None, stdout=None, stderr=None, preexec_fn=None, close_fds=False, shell=False, cwd=None, env=None, *args_, **kw): if executable is None and not shell: executable = full_executable_path(args[0], env or os.environ) super(Popen,self).__init__( args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, *args_, **kw) ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue8557> _______________________________________