[ python-Bugs-548661 ] os.popen w/o using the shell
SourceForge.net
noreply at sourceforge.net
Tue Nov 21 09:15:36 CET 2006
Bugs item #548661, was opened at 2002-04-25 08:30
Message generated for change (Comment added) made by nnorwitz
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=548661&group_id=5470
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Feature Request
>Status: Closed
>Resolution: Out of Date
Priority: 5
Private: No
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: Neal Norwitz (nnorwitz)
Date: 2006-11-21 00:15
Message:
Logged In: YES
user_id=33168
Originator: NO
I agree this isn't required in popen since you can do it with the
subprocess module. Closing.
----------------------------------------------------------------------
Comment By: Ian Bicking (ianbicking)
Date: 2005-04-19 09:45
Message:
Logged In: YES
user_id=210337
This may not matter enough to resolve now, with the advent
of the subprocess module.
----------------------------------------------------------------------
Comment By: Peter Ã
strand (astrand)
Date: 2003-11-01 08:29
Message:
Logged In: YES
user_id=344921
popen5 never uses the shell
(http://www.lysator.liu.se/~astrand/popen5/)
----------------------------------------------------------------------
Comment By: Julián Muñoz (julian69)
Date: 2003-01-08 08: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 11: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 11: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
More information about the Python-bugs-list
mailing list