45 | 45 |
# stderr=b'/bin/ls: cannot access /some/path/containing spaces: No such file or directory\n'
|
46 | 46 |
# )
|
47 | 47 |
|
48 | |
__version__ = "2.3.2"
|
|
48 |
__version__ = "2.3.3"
|
49 | 49 |
|
50 | 50 |
logger = logging.getLogger("procrunner")
|
51 | 51 |
logger.addHandler(logging.NullHandler())
|
|
303 | 303 |
command,
|
304 | 304 |
*,
|
305 | 305 |
timeout: Optional[float] = None,
|
306 | |
stdin: Optional[Union[bytes, int]] = None,
|
307 | |
print_stdout: bool = True,
|
308 | |
print_stderr: bool = True,
|
|
306 |
callback_stderr: Optional[Callable] = None,
|
309 | 307 |
callback_stdout: Optional[Callable] = None,
|
310 | |
callback_stderr: Optional[Callable] = None,
|
|
308 |
creationflags: int = 0,
|
311 | 309 |
environment: Optional[dict[str, str]] = None,
|
312 | 310 |
environment_override: Optional[dict[str, str]] = None,
|
|
311 |
preexec_fn: Optional[Callable] = None,
|
|
312 |
print_stderr: bool = True,
|
|
313 |
print_stdout: bool = True,
|
|
314 |
raise_timeout_exception: Any = ...,
|
|
315 |
stdin: Optional[Union[bytes, int]] = None,
|
313 | 316 |
win32resolve: bool = True,
|
314 | 317 |
working_directory: Optional[str] = None,
|
315 | |
raise_timeout_exception: Any = ...,
|
316 | 318 |
) -> subprocess.CompletedProcess:
|
317 | 319 |
"""
|
318 | 320 |
Run an external process.
|
|
330 | 332 |
stdout line.
|
331 | 333 |
:param callback_stderr: Optional function which is called for each
|
332 | 334 |
stderr line.
|
|
335 |
:param creationflags: flags that will be passed to subprocess call
|
333 | 336 |
:param dict environment: The full execution environment for the command.
|
334 | 337 |
:param dict environment_override: Change environment variables from the
|
335 | 338 |
current values for command execution.
|
|
339 |
:param preexec_fn: pre-execution function, will be passed to subprocess call
|
336 | 340 |
:param boolean win32resolve: If on Windows, find the appropriate executable
|
337 | 341 |
first. This allows running of .bat, .cmd, etc.
|
338 | 342 |
files without explicitly specifying their
|
|
398 | 402 |
stdin=stdin_pipe,
|
399 | 403 |
stdout=subprocess.PIPE,
|
400 | 404 |
stderr=subprocess.PIPE,
|
|
405 |
creationflags=creationflags,
|
|
406 |
preexec_fn=preexec_fn,
|
401 | 407 |
)
|
402 | 408 |
|
403 | 409 |
thread_pipe_pool = []
|