Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion dvc/remote/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def cache_exists(self, checksums, jobs=None, name=None):
def _upload(
self, from_file, to_info, name=None, no_progress_bar=False, **_kwargs
):
makedirs(fspath_py35(to_info.parent), exist_ok=True)
makedirs(to_info.parent, exist_ok=True)

tmp_file = tmp_fname(to_info)
copyfile(
Expand Down
14 changes: 14 additions & 0 deletions tests/unit/utils/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from dvc.utils import copyfile
from dvc.utils import file_md5
from dvc.utils import fix_env
from dvc.utils import makedirs
from dvc.utils import to_chunks
from tests.basic_env import TestDir

Expand Down Expand Up @@ -108,3 +109,16 @@ def test_copyfile(path, repo_dir):
)
else:
assert filecmp.cmp(src_info.fspath, dest_info.fspath, shallow=False)


def test_makedirs(repo_dir):
path = os.path.join(repo_dir.root_dir, "directory")
path_info = PathInfo(
os.path.join(repo_dir.root_dir, "another", "directory")
)

makedirs(path)
assert os.path.isdir(path)

makedirs(path_info)
assert os.path.isdir(path_info.fspath)