A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2004-November/050094.html below:

[Python-Dev] Re: Two patches for the new subprocess module

[Python-Dev] Re: Two patches for the new subprocess moduleRussell E. Owen rowen at cesmail.net
Tue Nov 23 21:47:37 CET 2004
In article <20041123150846.GA22827 at craig-wood.com>,
 Nick Craig-Wood <nick at craig-wood.com> wrote:

> I have submitted two patches for the subprocess module against cvs
> HEAD.  The first notifies the user of a common mistake...
>
> subprocess has a very easy to mistake error in it - forgetting to pass
> the command as a list.... with the patch...
> 
> >>> subprocess.call("ls", "-l")
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
>   File "subprocess.py", line 428, in call
>     return Popen(*args, **kwargs).wait()
>   File "subprocess.py", line 508, in __init__
>     raise TypeError("bufsize must be an integer - "
> TypeError: bufsize must be an integer - did you forget to pass your arguments 
> in a list?

I hope you didn't totally eliminate the ability for Popen and call to 
accept args as a string? It is a useful feature and one I've been using.

If you have broken this, please consider some alternative to your patch.

Perhaps changing the default for shell to True if args is a string, 
False if a list would suffice? I'm not sure this is really the right 
thing to do on all platforms, but it'd be an easy fix (use shell=None in 
the argument list and then convert it to True or False as needed).

One could imagine other fixes, such as offering one variant each of 
Popen and call that insists on args=string, leaving the main version to 
insist on args=list.

Regards,

-- Russell

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4