Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c2415eb

Browse files
committed
Issue #14616: Mention shlex.quote in subprocess docs.
Patch by Chris Rebert.
1 parent 65e2bef commit c2415eb

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

Doc/library/subprocess.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,10 @@ default values. The arguments that are most commonly needed are:
341341
from this vulnerability; see the Note in the :class:`Popen` constructor
342342
documentation for helpful hints in getting ``shell=False`` to work.
343343

344+
When using ``shell=True``, :func:`shlex.quote` can be used to properly
345+
escape whitespace and shell metacharacters in strings that are going to
346+
be used to construct shell commands.
347+
344348
These options, along with all of the other options, are described in more
345349
detail in the :class:`Popen` constructor documentation.
346350

0 commit comments

Comments
 (0)