mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 04:54:47 +08:00
add encoding parameter for subprocess.check_output() function in Python 3.6+ (#1095)
* add encoding parameter for check_output() function in Python 3.6+ * add errors parameter for subprocess.check_output() function
This commit is contained in:
committed by
Jelle Zijlstra
parent
16074c1e66
commit
c0bbfbdec5
@@ -46,8 +46,9 @@ if sys.version_info >= (3, 5):
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
encoding: str = ...,
|
||||
errors: str = ...) -> CompletedProcess: ...
|
||||
*,
|
||||
encoding: Optional[str] = ...,
|
||||
errors: Optional[str] = ...) -> CompletedProcess: ...
|
||||
else:
|
||||
# Nearly same args as Popen.__init__ except for timeout, input, and check
|
||||
def run(args: _CMD,
|
||||
@@ -151,7 +152,31 @@ else:
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...) -> int: ...
|
||||
|
||||
if sys.version_info >= (3, 4):
|
||||
if sys.version_info >= (3, 6):
|
||||
# 3.6 added encoding and errors
|
||||
def check_output(args: _CMD,
|
||||
bufsize: int = ...,
|
||||
executable: _TXT = ...,
|
||||
stdin: _FILE = ...,
|
||||
stderr: _FILE = ...,
|
||||
preexec_fn: Callable[[], Any] = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: _TXT = ...,
|
||||
env: _ENV = ...,
|
||||
universal_newlines: bool = ...,
|
||||
startupinfo: Any = ...,
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
*,
|
||||
timeout: float = ...,
|
||||
input: _TXT = ...,
|
||||
encoding: Optional[str] = ...,
|
||||
errors: Optional[str] = ...,
|
||||
) -> Any: ... # morally: -> _TXT
|
||||
elif sys.version_info >= (3, 4):
|
||||
# 3.4 added input
|
||||
def check_output(args: _CMD,
|
||||
bufsize: int = ...,
|
||||
@@ -266,8 +291,9 @@ class Popen:
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
encoding: str = ...,
|
||||
errors: str = ...) -> None: ...
|
||||
*,
|
||||
encoding: Optional[str] = ...,
|
||||
errors: Optional[str] = ...) -> None: ...
|
||||
else:
|
||||
def __init__(self,
|
||||
args: _CMD,
|
||||
|
||||
Reference in New Issue
Block a user