Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #29313
| From | Nobody <nobody@nowhere.com> |
|---|---|
| Subject | Re: Moving folders with content |
| Date | 2012-09-16 15:31 +0100 |
| Message-Id | <pan.2012.09.16.14.31.11.382000@nowhere.com> |
| Newsgroups | comp.lang.python |
| References | <mailman.785.1347782537.27098.python-list@python.org> <5055ac92$0$6940$e4fe514c@news2.news.xs4all.nl> |
| Organization | Zen Internet |
On Sun, 16 Sep 2012 12:40:18 +0200, Hans Mulder wrote: > But you should get into the habit of using shell=False whenever > possible, because it is much easier to get it right. More accurately, you should get into the habit of passing a list as the first argument, rather than a string. On Unix-like systems (including Mac OS X), this effectively requires shell=False. Passing a list with shell=True has behaviour which is well-defined, but rarely useful (the first element of the list will be executed as a shell command, the remaining elements will be available via the shell variables $1, $2, etc within that command). On Windows, the list is converted to a command string using the same quoting rules regardless of the value of the shell= parameter. The difference is that shell=False requires the "executable" to actually be a binary executable, while shell=True allows it to be some other type of file (e.g. a batch file, Python script, etc).
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
RE: Moving folders with content <jyoung79@kc.rr.com> - 2012-09-16 08:02 +0000
Re: Moving folders with content Hans Mulder <hansmu@xs4all.nl> - 2012-09-16 12:40 +0200
Re: Moving folders with content Nobody <nobody@nowhere.com> - 2012-09-16 15:31 +0100
Re: Moving folders with content Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-09-16 14:53 -0400
Re: Moving folders with content Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-09-16 16:53 -0400
csiph-web