@@ -55,7 +55,7 @@ API: Subprocess
5555 .. Note :: Enter and exit main context manager is produced as well.
5656 .. versionadded :: 4.1.0
5757
58- .. py :method :: execute(command, verbose = False , timeout = 1 * 60 * 60 , * , log_mask_re = None , stdin = None , open_stdout = True , open_stderr = True , ** kwargs)
58+ .. py :method :: execute(command, verbose = False , timeout = 1 * 60 * 60 , * , log_mask_re = None , stdin = None , open_stdout = True , open_stderr = True , cwd = None , env = None , ** kwargs)
5959
6060 Execute command and wait for return code.
6161
@@ -71,9 +71,13 @@ API: Subprocess
7171 :param stdin: pass STDIN text to the process
7272 :type stdin: ``typing.Union[bytes, str, bytearray, None] ``
7373 :param open_stdout: open STDOUT stream for read
74- :type open_stdout: bool
74+ :type open_stdout: `` bool ``
7575 :param open_stderr: open STDERR stream for read
76- :type open_stderr: bool
76+ :type open_stderr: ``bool ``
77+ :param cwd: Sets the current directory before the child is executed.
78+ :type cwd: ``typing.Optional[typing.Union[str, bytes]] ``
79+ :param env: Defines the environment variables for the new process.
80+ :type env: ``typing.Optional[typing.Mapping[typing.Union[str, bytes], typing.Union[str, bytes]]] ``
7781 :rtype: ExecResult
7882 :raises ExecHelperTimeoutError: Timeout exceeded
7983
@@ -83,7 +87,7 @@ API: Subprocess
8387 .. versionchanged :: 1.2.0 default timeout 1 hour
8488 .. versionchanged :: 1.2.0 stdin data
8589
86- .. py :method :: __call__ (command, verbose = False , timeout = 1 * 60 * 60 , * , log_mask_re = None , stdin = None , open_stdout = True , open_stderr = True , ** kwargs)
90+ .. py :method :: __call__ (command, verbose = False , timeout = 1 * 60 * 60 , * , log_mask_re = None , stdin = None , open_stdout = True , open_stderr = True , cwd = None , env = None , ** kwargs)
8791
8892 Execute command and wait for return code.
8993
@@ -99,16 +103,20 @@ API: Subprocess
99103 :param stdin: pass STDIN text to the process
100104 :type stdin: ``typing.Union[bytes, str, bytearray, None] ``
101105 :param open_stdout: open STDOUT stream for read
102- :type open_stdout: bool
106+ :type open_stdout: `` bool ``
103107 :param open_stderr: open STDERR stream for read
104- :type open_stderr: bool
108+ :type open_stderr: ``bool ``
109+ :param cwd: Sets the current directory before the child is executed.
110+ :type cwd: ``typing.Optional[typing.Union[str, bytes]] ``
111+ :param env: Defines the environment variables for the new process.
112+ :type env: ``typing.Optional[typing.Mapping[typing.Union[str, bytes], typing.Union[str, bytes]]] ``
105113 :rtype: ExecResult
106114 :raises ExecHelperTimeoutError: Timeout exceeded
107115
108116 .. note :: stdin channel is closed after the input processing
109117 .. versionadded :: 3.3.0
110118
111- .. py :method :: check_call(command, verbose = False , timeout = 1 * 60 * 60 , error_info = None , expected = (0 ,), raise_on_err = True , * , log_mask_re = None , stdin = None , open_stdout = True , open_stderr = True , exception_class = CalledProcessError, ** kwargs)
119+ .. py :method :: check_call(command, verbose = False , timeout = 1 * 60 * 60 , error_info = None , expected = (0 ,), raise_on_err = True , * , log_mask_re = None , stdin = None , open_stdout = True , open_stderr = True , cwd = None , env = None , exception_class = CalledProcessError, ** kwargs)
112120
113121 Execute command and check for return code.
114122
@@ -133,6 +141,10 @@ API: Subprocess
133141 :type open_stdout: ``bool ``
134142 :param open_stderr: open STDERR stream for read
135143 :type open_stderr: ``bool ``
144+ :param cwd: Sets the current directory before the child is executed.
145+ :type cwd: ``typing.Optional[typing.Union[str, bytes]] ``
146+ :param env: Defines the environment variables for the new process.
147+ :type env: ``typing.Optional[typing.Mapping[typing.Union[str, bytes], typing.Union[str, bytes]]] ``
136148 :param exception_class: Exception class for errors. Subclass of CalledProcessError is mandatory.
137149 :type exception_class: typing.Type[CalledProcessError]
138150 :rtype: ExecResult
@@ -144,7 +156,7 @@ API: Subprocess
144156 .. versionchanged :: 3.2.0 Exception class can be substituted
145157 .. versionchanged :: 3.4.0 Expected is not optional, defaults os dependent
146158
147- .. py :method :: check_stderr(command, verbose = False , timeout = 1 * 60 * 60 , error_info = None , raise_on_err = True , * , expected = (0 ,), log_mask_re = None , stdin = None , open_stdout = True , open_stderr = True , exception_class = CalledProcessError, ** kwargs)
159+ .. py :method :: check_stderr(command, verbose = False , timeout = 1 * 60 * 60 , error_info = None , raise_on_err = True , * , expected = (0 ,), log_mask_re = None , stdin = None , open_stdout = True , open_stderr = True , cwd = None , env = None , exception_class = CalledProcessError, ** kwargs)
148160
149161 Execute command expecting return code 0 and empty STDERR.
150162
@@ -169,6 +181,10 @@ API: Subprocess
169181 :type open_stdout: ``bool ``
170182 :param open_stderr: open STDERR stream for read
171183 :type open_stderr: ``bool ``
184+ :param cwd: Sets the current directory before the child is executed.
185+ :type cwd: ``typing.Optional[typing.Union[str, bytes]] ``
186+ :param env: Defines the environment variables for the new process.
187+ :type env: ``typing.Optional[typing.Mapping[typing.Union[str, bytes], typing.Union[str, bytes]]] ``
172188 :param exception_class: Exception class for errors. Subclass of CalledProcessError is mandatory.
173189 :type exception_class: typing.Type[CalledProcessError]
174190 :rtype: ExecResult
0 commit comments