Nick Coghlan <ncogh...@gmail.com> added the comment:

After a bit of thought, I realised I could use the string.Formatter API to 
implement a custom formatter for the shell command helpers that auto-escapes 
whitespace while leaving the other shell metacharacters alone (so you can still 
interpolate paths containing wildcards, etc).

People that want to bypass the autoescaping of whitespace can do the 
interpolation prior to the shell call, those that also want to escape shell 
metacharacters can use shlex.quote explicitly.

Diff can be seen here:
https://bitbucket.org/ncoghlan/cpython_sandbox/changeset/f19accc9a91b

----------
hgrepos: +85

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

Reply via email to