def readline(self, timeout):
buf = self.__remainder<EOL>while linefeed_byte not in buf:<EOL><INDENT>buf += self._read_timeout(timeout)<EOL><DEDENT>n = buf.index(linefeed_byte)<EOL>self.__remainder = buf[n + <NUM_LIT:1> :]<EOL>buf = buf[:n]<EOL>if (len(buf) > <NUM_LIT:0>) and (buf[-<NUM_LIT:1>] == cr_byte_value):<EOL><INDENT>buf = buf[:-<NUM_LIT:1>]<EOL><DEDENT>return u(buf)<EOL>
Read a line from the socket.  We assume no data is pending after the
line, so it's okay to attempt large reads.