Author chris.jerdonek
Recipients chris.jerdonek, docs@python
Date 2012-08-02.05:44:29
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1343886272.5.0.825552125397.issue15533@psf.upfronthosting.co.za>
In-reply-to
Content
The sentence describing Popen()'s cwd argument in the subprocess documentation seems reversed to me:

http://docs.python.org/dev/library/subprocess.html#subprocess.Popen

It says, "If cwd is not None, the child’s current directory will be changed to cwd before it is executed. Note that this directory is not considered when searching the executable, so you can’t specify the program’s path relative to cwd."

However, when cwd is not None, it seems like you *must* specify the program's path relative to cwd.  For example, when running a script containing the following using `./python.exe` from a source checkout--

    p = Popen(['./python.exe', '-V'], stdout=PIPE, stderr=PIPE, cwd='temp')
    
you get an: "OSError: [Errno 2] No such file or directory."

In contrast, when you *do* specify the program's path relative to cwd, it works--

    p = Popen(['../python.exe', '-V'], stdout=PIPE, stderr=PIPE, cwd='temp')

Issue 6374 seems to have made the same point in its second bullet, but the issue was closed without addressing that part of it.
History
Date User Action Args
2012-08-02 05:44:33chris.jerdoneksetrecipients: + chris.jerdonek, docs@python
2012-08-02 05:44:32chris.jerdoneksetmessageid: <1343886272.5.0.825552125397.issue15533@psf.upfronthosting.co.za>
2012-08-02 05:44:31chris.jerdoneklinkissue15533 messages
2012-08-02 05:44:29chris.jerdonekcreate