spawn(self,
stdout=None,
stdin=None,
stderr=None,
closefds=[ ] )
|
|
Fork, setup file descriptors, and exec child process.
The `stdout`, `stdin` and `stderr` file-like objects can be
raw file descriptors (ints) or file-like objects with a
``fileno`` method returning a file descriptor.
When building a pipe, one side of a pipe is used as `stdout`,
`stdin` or `stderr`, and the other is included in the
`closefds` list, so the child process will be able to detect a
broken pipe.
:param stdin: use as standard input of child process, defaults
to ``/dev/null``.
:type stdin: file-like object with a ``fileno`` method or raw
file descriptor (``int``).
:param stdout: use as standard output of child process,
defaults to internal pipe or ``/dev/null``.
:type stdout: file-like object with a ``fileno`` method or raw
file descriptor (``int``). If a logger was specified,
defaults to a pipe for logging, if no logger was
specified, defaults to ``/dev/null``.
:param stderr: use as standard error of child process.
Defaults to a pipe for error reporting (see `ExecProblem`)
and logging.
:type stderr: file-like object with a ``fileno`` method or raw
file descriptor (``int``).
:param closefds: file descriptors to close in the child process.
:type closefds: iterable of int
|