New submission from Brandon Craig Rhodes <bran...@rhodesmill.org>:

The only way to safely build shell command lines from inside of Python — which 
is necessary when sending commands across SSH, since that behaves like 
os.system() rather than like subprocess.call() — is to use the wonderful 
pipes.call() method to turn possibly-dangerous arguments, like filenames that 
might have spaces, special characters, and embedded "rm -r" calls, into 
perfectly quoted strings for an "sh"-like shell (say, bash or zsh).

This call is already recommended on mailing lists, blog posts, and Stack 
Overflow — and since it doesn't start with a "_", I think its public use is 
fair game. But the "pipes" documentation itself doesn't officially mention or 
support it. I think it should be added to the Standard Library documentation 
for "pipes". So. Yeah.

----------
assignee: d...@python
components: Documentation
messages: 115263
nosy: brandon-rhodes, d...@python
priority: normal
severity: normal
status: open
title: pipes.quote() needs to be documented
type: feature request
versions: Python 2.5, Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue9723>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to