This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

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 <>
The sentence describing Popen()'s cwd argument in the subprocess documentation seems reversed to me:

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.
Date User Action Args
2012-08-02 05:44:33chris.jerdoneksetrecipients: + chris.jerdonek, docs@python
2012-08-02 05:44:32chris.jerdoneksetmessageid: <>
2012-08-02 05:44:31chris.jerdoneklinkissue15533 messages
2012-08-02 05:44:29chris.jerdonekcreate