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

Skip to content

Commit 9ec1517

Browse files
committed
(Merge 3.4) Closes #21758: asyncio doc: mention explicitly that subprocess
parameters are bytes or character strings
2 parents 41dcf35 + 6bfd854 commit 9ec1517

2 files changed

Lines changed: 11 additions & 6 deletions

File tree

Doc/library/asyncio-subprocess.rst

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ Create a subprocess: high-level API using Process
2222

2323
.. function:: create_subprocess_shell(cmd, stdin=None, stdout=None, stderr=None, loop=None, limit=None, \*\*kwds)
2424

25-
Run the shell command *cmd* given as a string. Return a :class:`~asyncio.subprocess.Process`
26-
instance.
25+
Run the shell command *cmd*. See :meth:`BaseEventLoop.subprocess_shell` for
26+
parameters. Return a :class:`~asyncio.subprocess.Process` instance.
2727

2828
The optional *limit* parameter sets the buffer limit passed to the
2929
:class:`StreamReader`.
@@ -32,7 +32,8 @@ Create a subprocess: high-level API using Process
3232

3333
.. function:: create_subprocess_exec(\*args, stdin=None, stdout=None, stderr=None, loop=None, limit=None, \*\*kwds)
3434

35-
Create a subprocess. Return a :class:`~asyncio.subprocess.Process` instance.
35+
Create a subprocess. See :meth:`BaseEventLoop.subprocess_exec` for
36+
parameters. Return a :class:`~asyncio.subprocess.Process` instance.
3637

3738
The optional *limit* parameter sets the buffer limit passed to the
3839
:class:`StreamReader`.
@@ -50,7 +51,9 @@ Run subprocesses asynchronously using the :mod:`subprocess` module.
5051

5152
.. method:: BaseEventLoop.subprocess_exec(protocol_factory, \*args, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, \*\*kwargs)
5253

53-
Create a subprocess from one or more string arguments, where the first string
54+
Create a subprocess from one or more string arguments (character strings or
55+
bytes strings encoded to the :ref:`filesystem encoding
56+
<filesystem-encoding>`), where the first string
5457
specifies the program to execute, and the remaining strings specify the
5558
program's arguments. (Thus, together the string arguments form the
5659
``sys.argv`` value of the program, assuming it is a Python script.) This is
@@ -94,8 +97,9 @@ Run subprocesses asynchronously using the :mod:`subprocess` module.
9497

9598
.. method:: BaseEventLoop.subprocess_shell(protocol_factory, cmd, \*, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, \*\*kwargs)
9699

97-
Create a subprocess from *cmd*, which is a string using the platform's
98-
"shell" syntax. This is similar to the standard library
100+
Create a subprocess from *cmd*, which is a character string or a bytes
101+
string encoded to the :ref:`filesystem encoding <filesystem-encoding>`,
102+
using the platform's "shell" syntax. This is similar to the standard library
99103
:class:`subprocess.Popen` class called with ``shell=True``.
100104

101105
See :meth:`~BaseEventLoop.subprocess_exec` for more details about

Doc/library/os.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ Notes on the availability of these functions:
6565

6666

6767
.. _os-filenames:
68+
.. _filesystem-encoding:
6869

6970
File Names, Command Line Arguments, and Environment Variables
7071
-------------------------------------------------------------

0 commit comments

Comments
 (0)