[Pythonmac-SIG] Escaping commandline strings

Chris Weisiger cweisiger at msg.ucsf.edu
Tue Jan 4 21:21:12 CET 2011


I want to sanitize some strings (e.g. escape apostrophes, spaces, etc.)
before passing them to the commandline via subprocess. Unfortunately I can't
seem to find any built-in function to do this. Am I really going to have to
write up my own sanitizer? Not that it'd be much effort, but I'd much rather
use an official function than risk forgetting something.

-Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pythonmac-sig/attachments/20110104/e3fb2806/attachment.html>


More information about the Pythonmac-SIG mailing list