[docs] [issue15533] subprocess.Popen(cwd) documentation

Jan Lachnitt report at bugs.python.org
Wed Dec 19 16:28:49 CET 2012


Jan Lachnitt added the comment:

Hi all,

I have solved the problem by using absolute path of the executable. The reason why the executable didn't work properly may be that the executable's relative path was inconsistent with current directory. See the following example (I have made an executable which shows its argv and cwd). If it is called normally, then:

argv[0] = phsh0.exe
cwd = D:\Jenda\AutoLEED\TESTING\default

But if it is called by Python's subprocess.call from "D:\Jenda\AutoLEED\TESTING" as I want, then:

argv[0] = default\phsh0.exe
cwd = D:\Jenda\AutoLEED\TESTING\default

The executable may be confused by this inconsistency. So it is not the documentation, but Python itself what should be changed. The executable should be searched in cwd on any platform to avoid the inconsistency.

I have not yet updated my Python installation, so my results apply to 3.2.3.

----------

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


More information about the docs mailing list