[docs] [issue9723] pipes.quote() needs to be documented

Brandon Craig Rhodes report at bugs.python.org
Tue Aug 31 15:40:14 CEST 2010


New submission from Brandon Craig Rhodes <brandon at 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: docs at python
components: Documentation
messages: 115263
nosy: brandon-rhodes, docs at 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 <report at bugs.python.org>
<http://bugs.python.org/issue9723>
_______________________________________


More information about the docs mailing list