class documentation

class ErrorOutput: (source)

View In Hierarchy

Wrapper class for file-like error streams with failsafe de- and encoding of `str`, `bytes`, `unicode` and `Exception` instances.

Method __init__ :Parameters: - `destination`: a file-like object, a string (path to a file), `None` (write to `sys.stderr`, default), or evaluating to `False` (write() requests are ignored)...
Method close Close the error-output stream.
Method isatty Undocumented
Method write Write `data` to self.destination. Ignore, if self.destination is False.
Instance Variable decoding_errors Decoding error handler.
Instance Variable destination Where warning output is sent.
Instance Variable encoding The output character encoding.
Instance Variable encoding_errors Encoding error handler.
def __init__(self, destination=None, encoding=None, encoding_errors='backslashreplace', decoding_errors='replace'): (source)

:Parameters: - `destination`: a file-like object, a string (path to a file), `None` (write to `sys.stderr`, default), or evaluating to `False` (write() requests are ignored). - `encoding`: `destination` text encoding. Guessed if None. - `encoding_errors`: how to treat encoding errors.

def close(self): (source)

Close the error-output stream. Ignored if the destination is` sys.stderr` or `sys.stdout` or has no close() method.

def isatty(self): (source)

Undocumented

def write(self, data): (source)

Write `data` to self.destination. Ignore, if self.destination is False. `data` can be a `bytes`, `str`, or `Exception` instance.

decoding_errors = (source)

Decoding error handler.

destination = (source)

Where warning output is sent.

encoding = (source)

The output character encoding.

encoding_errors = (source)

Encoding error handler.