without shell

Donn Cave donn at u.washington.edu
Fri Jun 10 21:07:43 CEST 2005

In article <11ajkap3isrmndf at corp.supernews.com>,
 Grant Edwards <grante at visi.com> wrote:
> According to the current module reference, that's the behavior
> of the os.popen*() functions:
> http://docs.python.org/lib/os-newstreams.html#os-newstreams
> > On UNIX, os.popen is posix.popen, is a simple wrapper around
> > the C library popen.  It always invokes the shell.
> Not according the the docs:
>   Also, for each of these variants, on Unix, cmd may be a
>   sequence, in which case arguments will be passed directly to
>   the program without shell intervention (as with os.spawnv()).
>   If cmd is a string it will be passed to the shell (as with
>   os.system()).
> It's not exactly clear what "these variants" refer to, but I
> read it as referring to all of the the os.popen functions.
> Perhaps it only refers to os.popen[234]?

Right.  The paragraphs seem a little scrambled.  Note
the use of "cmd" instead of "command" as the parameter
is named for popen().  Also note "These methods do not
make it possible to retrieve the return code from the
child processes", after the popen() paragraph above tells
you how to do it (using the better term "exit status".)

Or one may look at the source.

   Donn Cave, donn at u.washington.edu

More information about the Python-list mailing list