(self)
return c
Read one character, replacing CR LF with CR.
Read one character, replacing CR LF with CR.
Read one character replacing CR LF with CR .
def read_one(self):
        """Read one character, replacing CR LF with CR."""
        c = self.read(1)
        if not c:
            return c
        # report CRLF as CR
        # but LFCR, LFCRLF, LFCRLFCR etc pass unmodified
        if (c == b'\r' and self._previous != b'\n') and self.peek(1) == b'\n':
            last, char = self._previous, self._current
            self.read(1)
            self._previous, self._current = last, char
        return c
def read_one ( self ) : c = self . read ( 1 ) if not c : return c # report CRLF as CR # but LFCR, LFCRLF, LFCRLFCR etc pass unmodified if ( c == b'\r' and self . _previous != b'\n' ) and self . peek ( 1 ) == b'\n' : last , char = self . _previous , self . _current self . read ( 1 ) self . _previous , self . _current = last , char return c