(self, stream, replace_newlines=False)
return stream
Wrap a stream so that we can read codepage bytes from it.
Wrap a stream so that we can read codepage bytes from it.
Wrap a stream so that we can read codepage bytes from it .
def wrap_input_stream(self, stream, replace_newlines=False):
        """Wrap a stream so that we can read codepage bytes from it."""
        # check for file-like objects that expect unicode, raw output otherwise
        if isinstance(stream, (
                io.TextIOWrapper, io.StringIO,
                codecs.StreamReaderWriter, codecs.StreamReader,
            )):
            stream = InputStreamWrapper(stream, self)
        if replace_newlines:
            return NewlineWrapper(stream)
        return stream
def wrap_input_stream ( self , stream , replace_newlines = False ) : # check for file-like objects that expect unicode, raw output otherwise if isinstance ( stream , ( io . TextIOWrapper , io . StringIO , codecs . StreamReaderWriter , codecs . StreamReader , ) ) : stream = InputStreamWrapper ( stream , self ) if replace_newlines : return NewlineWrapper ( stream ) return stream