(self, stream, encoding=None)
return wrapped
Wrap std bytes streams or redirected files to make them behave more like in Python 3.
Wrap std bytes streams or redirected files to make them behave more like in Python 3.
Wrap std bytes streams or redirected files to make them behave more like in Python 3 .
def _wrap_input_stream(self, stream, encoding=None):
        """Wrap std bytes streams or redirected files to make them behave more like in Python 3."""
        encoding = encoding or stream.encoding or 'utf-8'
        wrapped = codecs.getreader(encoding)(stream)
        wrapped.buffer = stream
        return wrapped
def _wrap_input_stream ( self , stream , encoding = None ) : encoding = encoding or stream . encoding or 'utf-8' wrapped = codecs . getreader ( encoding ) ( stream ) wrapped . buffer = stream return wrapped