Skip to content

Commit

Permalink
dvc dependency repo: Catch FileNotFoundError (#10501)
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
Honzys authored Aug 12, 2024
1 parent fa317d5 commit 9735b5a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dvc/dependency/repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def download(self, to: "Output", jobs: Optional[int] = None):
state=self.repo.state,
prompt=confirm,
)
except CheckoutError:
except (CheckoutError, FileNotFoundError):
super().download(to=to, jobs=jobs)

def update(self, rev: Optional[str] = None):
Expand Down

0 comments on commit 9735b5a

Please sign in to comment.