diff --git a/fsspec/implementations/local.py b/fsspec/implementations/local.py index f032d8aeb..4c588232f 100644 --- a/fsspec/implementations/local.py +++ b/fsspec/implementations/local.py @@ -60,7 +60,12 @@ def ls(self, path, detail=False, **kwargs): info = self.info(path) if info["type"] == "directory": with os.scandir(path) as it: - infos = [self.info(f) for f in it] + infos = [] + for f in it: + try: + infos.append(self.info(f)) + except FileNotFoundError: + pass else: infos = [info]