

def readline(self, size=(- 1)):
    buf = self._rbuf
    buf.seek(0, 2)
    if (buf.tell() > 0):
        buf.seek(0)
        bline = buf.readline(size)
        if (bline.endswith('\n') or (len(bline) == size)):
            self._rbuf = StringIO()
            self._rbuf.write(buf.read())
            return bline
        del bline
    if (size < 0):
        if (self._rbufsize <= 1):
            buf.seek(0)
            buffers = [buf.read()]
            self._rbuf = StringIO()
            data = None
            recv = self._sock.recv
            while True:
                try:
                    while (data != '\n'):
                        data = recv(1)
                        if (not data):
                            break
                        buffers.append(data)
                except OpenSSL.SSL.WantReadError:
                    continue
                break
            return ''.join(buffers)
        buf.seek(0, 2)
        self._rbuf = StringIO()
        while True:
            try:
                data = self._sock.recv(self._rbufsize)
            except OpenSSL.SSL.WantReadError:
                continue
            if (not data):
                break
            nl = data.find('\n')
            if (nl >= 0):
                nl += 1
                buf.write(data[:nl])
                self._rbuf.write(data[nl:])
                del data
                break
            buf.write(data)
        return buf.getvalue()
    else:
        buf.seek(0, 2)
        buf_len = buf.tell()
        if (buf_len >= size):
            buf.seek(0)
            rv = buf.read(size)
            self._rbuf = StringIO()
            self._rbuf.write(buf.read())
            return rv
        self._rbuf = StringIO()
        while True:
            try:
                data = self._sock.recv(self._rbufsize)
            except OpenSSL.SSL.WantReadError:
                continue
            if (not data):
                break
            left = (size - buf_len)
            nl = data.find('\n', 0, left)
            if (nl >= 0):
                nl += 1
                self._rbuf.write(data[nl:])
                if buf_len:
                    buf.write(data[:nl])
                    break
                else:
                    return data[:nl]
            n = len(data)
            if ((n == size) and (not buf_len)):
                return n
            if (n >= left):
                buf.write(data[:left])
                self._rbuf.write(data[left:])
                break
            buf.write(data)
            buf_len += n
        return buf.getvalue()

dataset/ETHPy150Open Bolton-and-Menk-GIS/restapi/restapi/requests/packages/urllib3/contrib/pyopenssl.py fileobject.readline/VarMisuse@596/699 `data`->`n`