def __init__()

in teamcity/messages.py [0:0]


    def __init__(self, output=None, now=_time, encoding='auto', output_handler=None):
        if output_handler is None:
            output_handler = TeamCityMessagesPrinter(output)
        self.output_handler = output_handler
        self.now = now

        if encoding and encoding != 'auto':
            self.encoding = encoding
        elif getattr(output, 'encoding', None) or encoding == 'auto':
            # Default encoding to 'utf-8' because it sucks if we fail with a
            # `UnicodeEncodeError` simply because LANG didn't get propagated to
            # a subprocess or something and sys.stdout.encoding is None
            self.encoding = getattr(output, 'encoding', None) or 'utf-8'
        else:
            self.encoding = None