-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
Open
Labels
docsDocumentation in the Doc dirDocumentation in the Doc dirpendingThe issue will be closed if no feedback is providedThe issue will be closed if no feedback is provided
Description
Documentation
I had been using " ".join(shlex.escape(x) for x in args), not realizing that shlex.join(args) is exactly that.
The docstring is just """Return a shell-escaped string from *split_command*.""". I'd like to see something like
"""
Return a shell-escaped string from *split_command*.
That is, given a list of strings, return a string that, when printed,
can be copy-pasted into a shell and provide an argc of len(split_command).
For example:
>>> print(shlex.join(['echo', 'foo \"bar\" baz']))
echo 'foo "bar" baz'
>>>
$ echo 'foo "bar" baz'
foo "bar" baz
$
"""Linked PRs
Metadata
Metadata
Assignees
Labels
docsDocumentation in the Doc dirDocumentation in the Doc dirpendingThe issue will be closed if no feedback is providedThe issue will be closed if no feedback is provided
Projects
Status
Todo