Message146367
| Author |
ncoghlan |
| Recipients |
alex, cvrebert, eric.araujo, ncoghlan, pitrou |
| Date |
2011年10月25日.12:47:31 |
| SpamBayes Score |
9.140378e-06 |
| Marked as misclassified |
No |
| Message-id |
<1319546852.21.0.708857249703.issue13238@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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 |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2011年10月25日 12:47:32 | ncoghlan | set | recipients:
+ ncoghlan, pitrou, eric.araujo, alex, cvrebert |
| 2011年10月25日 12:47:32 | ncoghlan | set | messageid: <1319546852.21.0.708857249703.issue13238@psf.upfronthosting.co.za> |
| 2011年10月25日 12:47:31 | ncoghlan | link | issue13238 messages |
| 2011年10月25日 12:47:31 | ncoghlan | create |
|