def _read_chunk(self, sz):
        chunk = None
        try:
            chunk = os.read(self._fd, sz)
            self._bd.add(chunk)
        except EnvironmentError, e:
            if e.errno in [errno.EAGAIN, errno.EWOULDBLOCK]:
                assert chunk is None
                gevent.socket.wait_read(self._fd)
            else:
                raise

        self.got_eof = (chunk == '')
dataset/ETHPy150Open wal-e/wal-e/wal_e/pipebuf.py/NonBlockBufferedReader._read_chunk/original