[issue5484] subprocess.call() fails for .bat files on Windows, if executable path contains parenthesis

Erik Sandberg report at bugs.python.org
Fri Mar 13 21:03:36 CET 2009


Erik Sandberg <sandberg at virtutech.com> added the comment:

Did you test your code? I'm pretty sure I tried almost exactly the code
you suggest, and got an error like "'t' is not recognized as an internal
or external command...' (I cannot test this right now as I don't have
access to Windows machines). In order to use shell=False, I think the
correct thing should be something like this, though I haven't tried it
myself yet:
subprocess.call(["/c", "t(o.bat"], executable="cmd.exe")

(this guess is based on what I read in msdn.com's docs on CreateProcess:
"""To run a batch file, you must start the command interpreter; set
lpApplicationName to cmd.exe and set lpCommandLine to the following
arguments: /c plus the name of the batch file.""")

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5484>
_______________________________________


More information about the Python-bugs-list mailing list