]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
Add shlex.quote function, to escape filenames and command lines (#9723).
authorÉric Araujo <merwok@netwok.org>
Wed, 27 Jul 2011 16:29:31 +0000 (18:29 +0200)
committerÉric Araujo <merwok@netwok.org>
Wed, 27 Jul 2011 16:29:31 +0000 (18:29 +0200)
commit9bce311ea4f58ec04cab356a748e173ecfea381c
treefd767a62dab42bb79ce2e86a2ac6fb970930c10e
parentfcdaaa9011be28d4653dadc92df4a94b2f669711
Add shlex.quote function, to escape filenames and command lines (#9723).

This function used to live as pipes.quote, where it was undocumented but
used anyway.  (An alias still exists for backward compatibility.)  The
tests have been moved as is, but the code of the function was changed to
use a regex instead of a loop with string comparisons (at Ian Bicking’s
suggestion).  I’m terrible at regexes, so any feedback is welcome.
Doc/library/shlex.rst
Doc/library/subprocess.rst
Lib/pipes.py
Lib/shlex.py
Lib/test/test_pipes.py
Lib/test/test_shlex.py
Misc/NEWS