[Python-Dev] popen behavior

Martin v. Loewis martin@v.loewis.de
18 Jun 2002 22:44:50 +0200


Kevin Butler <kbutler@campuspipeline.com> writes:

> - Should we maintain the os.popen & popen2.popen dual exposure with
> their different argument & return value orders?

Certainly. Any change to that will break existing applications.

> - Should we maintain the different behavior for lists of arguments vs
> strings? (it does not appear to be documented)
> 
> That is, the command can be either a string or a list of strings.  If
> it is a list of strings, it is executed as a new process without a
> shell. If it is a string, CPython's popen2 module attempts to execute
> it as a shell command-line as follows:
>          if isinstance(cmd, types.StringTypes):
>              cmd = ['/bin/sh', '-c', cmd]

If you propose to extend argument processing for one of the functions
so that passing the additional arguments in current releases produces
an exception - then adding this extension would be desirable if that
adds consistency.

Regards,
Martin