Antoine Pitrou <pit...@free.fr> added the comment: > 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. ---------- _______________________________________ 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