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 @@ -149,7 +149,7 @@ def walk_files(self, path_info):
yield PathInfo(fname)

def get_file_checksum(self, path_info):
return file_md5(fspath_py35(path_info))[0]
return file_md5(path_info)[0]

def remove(self, path_info):
if path_info.scheme != "local":
Expand Down
2 changes: 2 additions & 0 deletions dvc/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ def file_md5(fname):
from dvc.progress import Tqdm
from dvc.istextfile import istextfile

fname = fspath_py35(fname)

if os.path.exists(fname):
hash_md5 = hashlib.md5()
binary = not istextfile(fname)
Expand Down
8 changes: 8 additions & 0 deletions tests/unit/utils/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import pytest

from dvc.path_info import PathInfo
from dvc.utils import file_md5
from dvc.utils import fix_env
from dvc.utils import to_chunks

Expand Down Expand Up @@ -71,3 +73,9 @@ def test_fix_env_pyenv(path, orig):
"PYENV_HOOK_PATH": "/some/hook/path",
}
assert fix_env(env)["PATH"] == orig


def test_file_md5(repo_dir):
fname = repo_dir.FOO
fname_object = PathInfo(fname)
assert file_md5(fname) == file_md5(fname_object)