Message146154
| Author |
pitrou |
| Recipients |
alex, cvrebert, eric.araujo, ncoghlan, pitrou |
| Date |
2011年10月22日.00:41:40 |
| SpamBayes Score |
0.0050686896 |
| Marked as misclassified |
No |
| Message-id |
<1319243833.3382.19.camel@localhost.localdomain> |
| In-reply-to |
<1319242835.59.0.0284187860493.issue13238@psf.upfronthosting.co.za> |
| Content |
> Yes, you have to be careful that "dirname" is legal in the shell, but
> that usually isn't a big problem in practice, because dirname came
> from a previous listdir call, or you otherwise know that it's valid to
> interpolate it into the command
I don't understand. os.listdir() doesn't escape filenames for you.
Having been bitten several times by almost-working shell commands which
would crash when one of the 10000 files being processed had a space in
it (ironically, I think that was in the Python source tree with some of
the old Mac directories), I think we really don't want to publish a
function which encourages people to pass unescaped arguments to the
shell. |
|