[Python-Dev] subprocess insufficiently platform-independent? (original) (raw)
Fredrik Lundh fredrik at pythonware.com
Wed Aug 27 19:34:14 CEST 2008
- Previous message: [Python-Dev] subprocess insufficiently platform-independent?
- Next message: [Python-Dev] 2to3 patches and reviews
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Guido van Rossum wrote:
I can't reproduce this as described. Which Windows version? This sounds like one of those things that could well vary by Windows version; if it works for you in Vista it may well be broken in XP. It could also vary by other setup parameters besides PATHEXT.
It works the same way on XP, at least:
import subprocess cmd = ['svn', 'ls', '.'] subprocess.call(cmd, shell=False) svn: '.' is not a working copy 1
According to the MS docs, CreateProcess works the same way on at least 2K, XP and Vista. The documentation is a bit vague (as usual), but it contains an example that implies that CreateProcess always adds ".exe" if not already there, and that you need to use the command interpreter (that is, shell=True) if you want to run something that's not a Windows executable module (e.g. a batch file).
- Previous message: [Python-Dev] subprocess insufficiently platform-independent?
- Next message: [Python-Dev] 2to3 patches and reviews
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]