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

SourceForge.net noreply at sourceforge.net
Tue Apr 19 18:45:05 CEST 2005


Bugs item #548661, was opened at 2002-04-25 10:30
Message generated for change (Comment added) made by ianbicking
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: Ian Bicking (ianbicking)
Date: 2005-04-19 11: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 10: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 10: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 13: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 13: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