API: exceptions

exception exec_helpers.ExecHelperError(Exception)[source]

Base class for all exceptions raised inside.

exception exec_helpers.DeserializeValueError(ExecHelperError, ValueError)

Deserialize impossible.

exception exec_helpers.ExecCalledProcessError(ExecHelperError)[source]

Base class for process call errors.

class ExecHelperTimeoutProcessError(ExecCalledProcessError):

Timeout based errors.

New in version 3.4.0.

exec_helpers.timeout

typing.Union[int, float]

exec_helpers.result

Execution result

Return type:ExecResult
exec_helpers.stdout

str stdout string or brief string

exec_helpers.stderr

str stdout string or brief string

exception exec_helpers.ExecHelperNoKillError(ExecHelperTimeoutProcessError)[source]

Impossible to kill process.

New in version 3.4.0.

__init__(self, result, timeout)[source]

Exception for error on process calls.

Parameters:
  • result (ExecResult) – execution result
  • timeout (typing.Union[int, float]) – timeout for command
exception exec_helpers.ExecHelperTimeoutError(ExecHelperTimeoutProcessError)[source]

Execution timeout.

Changed in version 1.3.0: provide full result and timeout inside.

Changed in version 1.3.0: subclass ExecCalledProcessError

__init__(self, result, timeout)[source]

Exception for error on process calls.

Parameters:
  • result (ExecResult) – execution result
  • timeout (typing.Union[int, float]) – timeout for command
exception exec_helpers.CalledProcessError(ExecCalledProcessError)[source]

Exception for error on process calls.

Changed in version 1.1.1: - provide full result

__init__(result, expected=(0, ))[source]
Parameters:
  • result (ExecResult) – execution result
  • expected (typing.Iterable[typing.Union[int, ExitCodes]]) – expected return codes

Changed in version 3.4.0: Expected is not optional, defaults os dependent

result

Execution result

Return type:ExecResult
cmd

str command

returncode

return code

Return type:typing.Union[int, ExitCodes]
expected

expected return codes

Return type:typing.List[typing.Union[int, ExitCodes]]
stdout

str stdout string or brief string

stderr

str stdout string or brief string

exception exec_helpers.ParallelCallProcessError(ExecCalledProcessError)[source]

Exception during parallel execution.

__init__(command, errors, results, expected=(0, ))[source]
Parameters:
  • command (str) – command
  • errors (typing.Dict[typing.Tuple[str, int], ExecResult]) – results with errors
  • results (typing.Dict[typing.Tuple[str, int], ExecResult]) – all results
  • expected (typing.Iterable[typing.Union[int, ExitCodes]]) – expected return codes

Changed in version 1.0: - fixed inheritance

Changed in version 3.4.0: Expected is not optional, defaults os dependent

cmd

str command

errors

results with errors

Return type:typing.Dict[typing.Tuple[str, int], ExecResult]
results

all results

Return type:typing.Dict[typing.Tuple[str, int], ExecResult]
expected

expected return codes

Return type:typing.List[typing.Union[int, ExitCodes]]
exception exec_helpers.ParallelCallExceptions(ParallelCallProcessError)[source]

Exception raised during parallel call as result of exceptions.

__init__(command, exceptions, errors, results, expected=(0, ))[source]
Parameters:
  • command (str) – command
  • exceptions (typing.Dict[typing.Tuple[str, int], Exception]) – Exception on connections
  • errors (typing.Dict[typing.Tuple[str, int], ExecResult]) – results with errors
  • results (typing.Dict[typing.Tuple[str, int], ExecResult]) – all results
  • expected (typing.Iterable[typing.Union[int, ExitCodes]]) – expected return codes

Changed in version 1.0: - fixed inheritance

Changed in version 3.4.0: Expected is not optional, defaults os dependent

cmd

str command

exceptions

typing.Dict[typing.Tuple[str, int], Exception] Exception on connections

errors

results with errors

Return type:typing.Dict[typing.Tuple[str, int], ExecResult]
results

all results

Return type:typing.Dict[typing.Tuple[str, int], ExecResult]
expected

expected return codes

Return type:typing.List[typing.Union[int, ExitCodes]]