classification
Title: subprocess: args with shell=True is not documented on Windows
Type: Stage:
Components: Documentation, Library (Lib) Versions:
process
Status: closed Resolution: duplicate
Dependencies: 16115 Superseder: subprocess.check_output() docs misrepresent what shell=True does
View: 20344
Assigned To: docs@python Nosy List: Arfrever, docs@python, martin.panter, rosslagerwall, techtonik, vstinner
Priority: normal Keywords:

Created on 2011-10-17 11:21 by techtonik, last changed 2015-10-19 01:21 by martin.panter. This issue is now closed.

Messages (8)
msg145662 - (view) Author: anatoly techtonik (techtonik) Date: 2011-10-17 11:21
For UNIX, it is said that if shell=False then you need to pass `args` as a list (if you want to pass any parameters to executable). Is that true for Windows (and perhaps other platforms) as well?

Again, for UNIX it is said that with shell=True, and args is a list - every item except the first one is an argument to the shell itself. Is it the same on Windows?


It would be better to just give advice in `shell` parameter description to "pass args as a list with shell=False or else you'll lose params in Unix. If shell=True you need to pass args as a string, because list is needed only if you need to pass arguments to shell itself."
msg145663 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2011-10-17 11:24
See also issues #7839, #8972 and #10197.
msg145671 - (view) Author: anatoly techtonik (techtonik) Date: 2011-10-17 11:48
Looks like a can of worms. For now I'll be pretty fine if this stuff is at least properly documented.
msg145672 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2011-10-17 11:50
> For now I'll be pretty fine if this stuff is at least
> properly documented.

Can you propose a document patch describing the current behaviour?
msg145674 - (view) Author: anatoly techtonik (techtonik) Date: 2011-10-17 12:01
Certainly not right now as I don't have development environment setup. Perhaps in a few days if somebody pings me. It could be a lot easier with online editor, of course - http://code.google.com/p/pydotorg/issues/detail?id=6
msg145677 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2011-10-17 12:24
> Certainly not right now as I don't have development environment setup

See our development guide to get such environment:
http://docs.python.org/devguide/setup.html

> It could be a lot easier with online editor

Would like like to work on this project? (provide an online editor)
msg145726 - (view) Author: anatoly techtonik (techtonik) Date: 2011-10-17 16:22
On Mon, Oct 17, 2011 at 3:24 PM, STINNER Victor <report@bugs.python.org> wrote:
>
>> Certainly not right now as I don't have development environment setup
>
> See our development guide to get such environment:
> http://docs.python.org/devguide/setup.html

I know. There is better tool at
https://bitbucket.org/techtonik/devinabox but I have only 500Mb left
on my system drive and there are still more problems I need to handle.

>> It could be a lot easier with online editor
>
> Would like like to work on this project? (provide an online editor)

Do you mean would I like to work on it? Actually, I made a prototype
on AppEngine that waits for JS guru to tune CodeMirror interface. If
somebody is interested to help, I've just uploaded the code to
http://code.google.com/p/pydotorg/source/browse/?repo=doceditor
msg253166 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2015-10-19 01:21
I think the documentation changes made for Issue 16115 should address your first question (shell=False). For shell=True, see the discussion at Issue 20344. Perhaps you can review my patch.
History
Date User Action Args
2015-10-19 01:21:59martin.pantersetstatus: open -> closed

dependencies: + test the executable arg to Popen() and improve related docs
superseder: subprocess.check_output() docs misrepresent what shell=True does

nosy: + martin.panter
messages: + msg253166
resolution: duplicate
2011-10-17 16:22:45techtoniksetmessages: + msg145726
2011-10-17 14:00:59Arfreversetnosy: + Arfrever
2011-10-17 12:24:22vstinnersetmessages: + msg145677
2011-10-17 12:12:14rosslagerwallsetnosy: + rosslagerwall
2011-10-17 12:01:58techtoniksetmessages: + msg145674
2011-10-17 11:50:10vstinnersetmessages: + msg145672
2011-10-17 11:48:17techtoniksetmessages: + msg145671
2011-10-17 11:24:20vstinnersetnosy: + vstinner
messages: + msg145663
2011-10-17 11:21:33techtonikcreate