[issue20927] Different behaviour on Posix and Windows when using subprocess.Popen(..., cwd=path)

Terry J. Reedy report at bugs.python.org
Sat Mar 15 02:40:24 CET 2014


Terry J. Reedy added the comment:

I am sure that using / instead of \, which is to say, not using os.sep, is the problem as / is *not* allowed in Windows command names even though the substitution works for paths given as options. In a Windows console,
> python # works
> .\python # works
> ./python # see /python as an option for the . program, which does not exist.

I suspect that shell=True cause subprocess to execute "shell ./app" (howver 'shell' is spelled on the system), with whatever other options and quotation are needed to make ./app work as an option passed to shell instead of a command to be executed directly.

I also suspect that passing ".\\app" might work, which would mean that you should use .%sapp" % os.sep to get a cross-platform string. If so, please close this issue.

----------
nosy: +terry.reedy

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


More information about the Python-bugs-list mailing list