| Home | Trees | Indices | Help |
|---|
|
|
Description of a child process, for error handling.
| Instance Methods | |||
|
|||
|
|||
|
|||
|
|||
| Method Details |
Create a child process descriptor. The child process must have already been created. The `command`, `args` and `expected` parameters are used for error reporting. :param command: name of the child process executable :type command: str :param args: child process arguments (argv) :type args: sequence of str :param expected: valid exit status values :type expected: int or sequence of int |
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
|
Wait for process and return exit result. This (internally used) variant of `wait` is useful when you want to wait for a child process, but not raise an exception if it was terminated abnormally. Typically, that's what you want if you killed the child process. :return: second element of the tuple returned by os.wait() |
Wait for process and check its termination status.
If the process exited, set ``self.status`` to its exit status.
if the process was terminated by a signal, set ``self.signal``
to the value of this signal.
:raise ExecProblem: process was killed by a signal or exit
status is not is ``self.expected``
|
| Home | Trees | Indices | Help |
|---|
| Generated by Epydoc 3.0beta1 on Wed Sep 5 09:53:13 2007 | http://epydoc.sourceforge.net |