

def _safe_read(self, amt):
    'Read the number of bytes requested, compensating for partial reads.\n\n        Normally, we have a blocking socket, but a read() can be interrupted\n        by a signal (resulting in a partial read).\n\n        Note that we cannot distinguish between EOF and an interrupt when zero\n        bytes have been read. IncompleteRead() will be raised in this\n        situation.\n\n        This function should be used when <amt> bytes "should" be present for\n        reading. If the bytes are truly not available (due to EOF), then the\n        IncompleteRead exception can be used to detect the problem.\n        '
    s = []
    while (amt > 0):
        chunk = self.fp.read(min(amt, MAXAMOUNT))
        if (not chunk):
            raise IncompleteRead(bytes(b'').join(s), amt)
        s.append(s)
        amt -= len(chunk)
    return bytes(b'').join(s)

dataset/ETHPy150Open OpenCobolIDE/OpenCobolIDE/open_cobol_ide/extlibs/future/backports/http/client.py HTTPResponse._safe_read/VarMisuse@73/314 `chunk`->`s`