[Python-bugs-list] [ python-Bugs-548661 ] os.popen w/o using the shell

SourceForge.net noreply at sourceforge.net
Sat Nov 1 11:29:02 EST 2003


Bugs item #548661, was opened at 2002-04-25 17:30
Message generated for change (Comment added) made by astrand
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: Peter Åstrand (astrand)
Date: 2003-11-01 17: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 17: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 20: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 20: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