Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions src/dvc_objects/fs/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,14 @@ def put_file(self, lpath, rpath, callback=None, **kwargs):
os.replace(tmp_file, rpath)

def get_file(self, rpath, lpath, callback=None, **kwargs):
if self.isdir(rpath):
# emulating fsspec's localfs.get_file
self.makedirs(lpath, exist_ok=True)
return

copyfile(rpath, lpath, callback=callback)
try:
copyfile(rpath, lpath, callback=callback)
except IsADirectoryError:
if self.isdir(rpath):
# emulating fsspec's localfs.get_file
self.makedirs(lpath, exist_ok=True)
else:
raise

def mv(self, path1, path2, **kwargs):
self.makedirs(self._parent(path2), exist_ok=True)
Expand Down