def METHOD_NAME(self):
    t0 = time.time()
    while True:
        try:
            f = h5py.File(self.path, self.mode)
            return f
        except (OSError, PermissionError, RuntimeError):
            info(f'file opener ({self.mode})', 'waiting for file to be unlocked')
        time.sleep(self.test_delay)  # don't overwhelm the FS by very fast repeated calls.
        if time.time() - t0 > self.timeout:
            raise RuntimeError('waiting for file unlock timed out')