summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio
diff options
context:
space:
mode:
authorsbstp <sbstp@users.noreply.github.com>2019-05-27 23:51:19 (GMT)
committerMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2019-05-27 23:51:19 (GMT)
commitf0d4c64019ecf8a5f362aa5a478786241613e5c3 (patch)
treeba78feaf8749f5ddc5ad66fb369aba3a90d1567d /Lib/asyncio
parenta3568417c49f36860393075b21c93996a5f6799b (diff)
downloadcpython-f0d4c64019ecf8a5f362aa5a478786241613e5c3.zip
cpython-f0d4c64019ecf8a5f362aa5a478786241613e5c3.tar.gz
cpython-f0d4c64019ecf8a5f362aa5a478786241613e5c3.tar.bz2
bpo-36686: Improve the documentation of the std* params in loop.subprocess_exec (GH-13586)
https://bugs.python.org/issue36686
Diffstat (limited to 'Lib/asyncio')
-rw-r--r--Lib/asyncio/base_events.py19
1 files changed, 18 insertions, 1 deletions
diff --git a/Lib/asyncio/base_events.py b/Lib/asyncio/base_events.py
index e5cd14b..68105ee 100644
--- a/Lib/asyncio/base_events.py
+++ b/Lib/asyncio/base_events.py
@@ -1555,6 +1555,7 @@ class BaseEventLoop(events.AbstractEventLoop):
stderr=subprocess.PIPE,
universal_newlines=False,
shell=True, bufsize=0,
+ encoding=None, errors=None, text=None,
**kwargs):
if not isinstance(cmd, (bytes, str)):
raise ValueError("cmd must be a string")
@@ -1564,6 +1565,13 @@ class BaseEventLoop(events.AbstractEventLoop):
raise ValueError("shell must be True")
if bufsize != 0:
raise ValueError("bufsize must be 0")
+ if text:
+ raise ValueError("text must be False")
+ if encoding is not None:
+ raise ValueError("encoding must be None")
+ if errors is not None:
+ raise ValueError("errors must be None")
+
protocol = protocol_factory()
debug_log = None
if self._debug:
@@ -1580,13 +1588,22 @@ class BaseEventLoop(events.AbstractEventLoop):
async def subprocess_exec(self, protocol_factory, program, *args,
stdin=subprocess.PIPE, stdout=subprocess.PIPE,
stderr=subprocess.PIPE, universal_newlines=False,
- shell=False, bufsize=0, **kwargs):
+ shell=False, bufsize=0,
+ encoding=None, errors=None, text=None,
+ **kwargs):
if universal_newlines:
raise ValueError("universal_newlines must be False")
if shell:
raise ValueError("shell must be False")
if bufsize != 0:
raise ValueError("bufsize must be 0")
+ if text:
+ raise ValueError("text must be False")
+ if encoding is not None:
+ raise ValueError("encoding must be None")
+ if errors is not None:
+ raise ValueError("errors must be None")
+
popen_args = (program,) + args
for arg in popen_args:
if not isinstance(arg, (str, bytes)):