(self)
return b''.join(s), c
Read line from text file, break on CR or CRLF (not LF).
Read line from text file, break on CR or CRLF (not LF).
Read line from text file break on CR or CRLF ( not LF ) .
def read_line(self):
        """Read line from text file, break on CR or CRLF (not LF)."""
        s = []
        while True:
            c = self.read_one()
            if not c or (c == b'\r' and self._previous != b'\n'):
                # break on CR, CRLF but allow LF, LFCR to pass
                break
            s.append(c)
            if len(s) == 255:
                c = b'\r' if self.peek(1) == b'\r' else None
                break
        return b''.join(s), c
def read_line ( self ) : s = [ ] while True : c = self . read_one ( ) if not c or ( c == b'\r' and self . _previous != b'\n' ) : # break on CR, CRLF but allow LF, LFCR to pass break s . append ( c ) if len ( s ) == 255 : c = b'\r' if self . peek ( 1 ) == b'\r' else None break return b'' . join ( s ) , c