Repository: iterative/dvc

Issue:
progress bar issue when computing big file md5 on windows
```
  File "c:\users\user\appdata\local\programs\python\python37-32\lib\site-packages\dvc\remote\local\__init__.py", line 426, in push
    download=False,                                                             
  File "c:\users\user\appdata\local\programs\python\python37-32\lib\site-packages\dvc\remote\local\__init__.py", line 398, in _process
    download=download,                                                          
  File "c:\users\user\appdata\local\programs\python\python37-32\lib\site-packages\dvc\remote\local\__init__.py", line 326, in status
    remote_exists = list(remote.cache_exists(md5s))                             
  File "c:\users\user\appdata\local\programs\python\python37-32\lib\site-packages\dvc\remote\local\__init__.py", line 254, in cache_exists
    for checksum in progress(md5s)                                              
  File "c:\users\user\appdata\local\programs\python\python37-32\lib\site-packages\dvc\remote\local\__init__.py", line 255, in <listcomp>
    if not self.changed_cache_file(checksum)                                    
  File "c:\users\user\appdata\local\programs\python\python37-32\lib\site-packages\dvc\remote\base.py", line 568, in changed_cache_file
    actual = self.get_checksum(cache_info)                                      
  File "c:\users\user\appdata\local\programs\python\python37-32\lib\site-packages\dvc\remote\base.py", line 249, in get_checksum
    checksum = self.get_file_checksum(path_info)                                
  File "c:\users\user\appdata\local\programs\python\python37-32\lib\site-packages\dvc\remote\local\__init__.py", line 228, in get_file_checksum
    return file_md5(fspath_py35(path_info))[0]                                  
  File "c:\users\user\appdata\local\programs\python\python37-32\lib\site-packages\dvc\utils\__init__.py", line 68, in file_md5
    progress.update_target(name, total, size)                                   
  File "c:\users\user\appdata\local\programs\python\python37-32\lib\site-packages\dvc\progress.py", line 66, in update_target
    self.refresh(self._bar(name, current, total))                               
  File "c:\users\user\appdata\local\programs\python\python37-32\lib\site-packages\dvc\progress.py", line 106, in _bar
    return num + pbar + percent + target_name                                   
TypeError: can only concatenate str (not "WindowsPathInfo") to str              
```

https://discordapp.com/channels/485586884165107732/485596304961962003/593010068270743562


Discussion:

Resolving patch:
diff --git a/dvc/utils/__init__.py b/dvc/utils/__init__.py
--- a/dvc/utils/__init__.py
+++ b/dvc/utils/__init__.py
@@ -2,14 +2,7 @@
 
 from __future__ import unicode_literals
 
-from dvc.utils.compat import (
-    str,
-    builtin_str,
-    open,
-    cast_bytes_py2,
-    StringIO,
-    fspath_py35,
-)
+from dvc.utils.compat import str, builtin_str, open, cast_bytes_py2, StringIO
 from dvc.utils.compat import fspath
 
 import os
@@ -380,8 +373,8 @@ def _visual_center(line, width):
 
 
 def relpath(path, start=os.curdir):
-    path = fspath_py35(path)
-    start = fspath_py35(os.path.abspath(start))
+    path = fspath(path)
+    start = os.path.abspath(fspath(start))
 
     # Windows path on different drive than curdir doesn't have relpath
     if os.name == "nt" and not os.path.commonprefix(


Test patch:
diff --git a/tests/unit/utils/test_fs.py b/tests/unit/utils/test_fs.py
--- a/tests/unit/utils/test_fs.py
+++ b/tests/unit/utils/test_fs.py
@@ -4,6 +4,7 @@
 import dvc
 import pytest
 from dvc.system import System
+from dvc.path_info import PathInfo
 from dvc.utils import relpath
 from dvc.utils.compat import str
 from dvc.utils.fs import (
@@ -142,5 +143,9 @@ def test_get_parent_dirs_up_to(path1, path2, expected_dirs):
 def test_relpath_windows_different_drives():
     path1 = os.path.join("A:", os.sep, "some", "path")
     path2 = os.path.join("B:", os.sep, "other", "path")
-
     assert relpath(path1, path2) == path1
+
+    info1, info2 = PathInfo(path1), PathInfo(path2)
+    rel_info = relpath(info1, info2)
+    assert isinstance(rel_info, str)
+    assert rel_info == path1