[Python-bugs-list] [ python-Bugs-548661 ] os.popen w/o using the shell
SourceForge.net
noreply@sourceforge.net
Wed, 08 Jan 2003 08:15:54 -0800
Bugs item #548661, was opened at 2002-04-25 15:30
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=548661&group_id=5470
Category: Python Library
Group: Feature Request
Status: Open
Resolution: None
Priority: 5
Submitted By: Ian Bicking (ianbicking)
Assigned to: Nobody/Anonymous (nobody)
Summary: os.popen w/o using the shell
Initial Comment:
I heard that there was an undocumented feature to the
os.popen family, where instead of passing a command
string as the first argument you could pass a list, as
[path, arg1, arg2, ...], and circumvent any shell
interpretation. I was disapointed to see that this was
not so ("popen() argument 1 must be string, not list"
ditto tuple)
I believe this would be an excellent feature -- using
the shell is a significant source of errors due to
quoting, as well as a serious security concern. 95% of
the time the shell is not required. The shell also
introduces portability concerns (e.g., bug #512433) --
creating a Python shell is not necessary when the shell
is usually superfluous anyway.
----------------------------------------------------------------------
Comment By: Julián Muñoz (julian69)
Date: 2003-01-08 16:15
Message:
Logged In: YES
user_id=77756
Does this mean that giving a list to popen2 free us from
taking care of the dangerous characters that could be
interprated/escaped by the shell ???
I don't find any documentation about this feature !!!
----------------------------------------------------------------------
Comment By: Ian Bicking (ianbicking)
Date: 2002-04-25 18:18
Message:
Logged In: YES
user_id=210337
I see you are correct. It would be nice if this feature was
consistent across all popen*, and was also documented (and
so also committed to with clear semantics)
----------------------------------------------------------------------
Comment By: Martin v. Löwis (loewis)
Date: 2002-04-25 18:13
Message:
Logged In: YES
user_id=21627
This feature is indeed available in popen2.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=548661&group_id=5470