dvc dependency repo: Catch FileNotFoundError (#10501)

- When checkouting non-existent file the _checkout_file recursively
  calls os.stat on a symlinked file which destination doesn't exist.
  This causes a FileNotFoundError but it is not catched and it causes
  an unexpected error instead.

Fixes #10500.
This commit is contained in:
Jan Stratil
2024-08-12 20:49:26 +05:45
committed by GitHub
parent fa317d5b1d
commit 9735b5aaa9
+1 -1
View File
@@ -115,7 +115,7 @@ class RepoDependency(Dependency):
state=self.repo.state,
prompt=confirm,
)
except CheckoutError:
except (CheckoutError, FileNotFoundError):
super().download(to=to, jobs=jobs)
def update(self, rev: Optional[str] = None):