Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #29313

Re: Moving folders with content

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!dedekind.zen.co.uk!zen.net.uk!hamilton.zen.co.uk!reader01.nrc01.news.zen.net.uk.POSTED!not-for-mail
From Nobody <nobody@nowhere.com>
Subject Re: Moving folders with content
Date Sun, 16 Sep 2012 15:31:07 +0100
User-Agent Pan/0.14.2 (This is not a psychotic episode. It's a cleansing moment of clarity.)
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>
MIME-Version 1.0
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding 8bit
Lines 20
Organization Zen Internet
NNTP-Posting-Host f209a2dd.news.zen.co.uk
X-Trace DXC=CJcdB?Cb5[FgN9e0JNPkjOa0UP_O8AJoL=dR0\ckLKG@WeZ<[7LZNRF;^>bE\k^nkHM2Z^cWRFGAKJ:^onDYDn<O
X-Complaints-To abuse@zen.co.uk
Xref csiph.com comp.lang.python:29313

Show key headers only | View raw


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 | NextPrevious in thread | Next in thread | Find similar | Unroll thread


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