Skip to content

Commit fe248aa

Browse files
committed
dvc: use replace instead of posixpath
1 parent 0c08c09 commit fe248aa

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

dvc/remote/gs.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from functools import wraps
66
import io
77
import os.path
8-
import posixpath
98

109
from funcy import cached_property
1110

@@ -148,7 +147,7 @@ def list_cache_paths(self):
148147

149148
def walk_files(self, path_info):
150149
for fname in self._list_paths(path_info.bucket, path_info.path):
151-
yield path_info / posixpath.relpath(fname, path_info.path)
150+
yield path_info.replace(fname)
152151

153152
def isdir(self, path_info):
154153
dir_path = path_info / ""
@@ -160,10 +159,10 @@ def isdir(self, path_info):
160159

161160
def exists(self, path_info):
162161
dir_path = path_info / ""
163-
file = next(
162+
fname = next(
164163
self._list_paths(path_info.bucket, path_info.path, max_items=1), ""
165164
)
166-
return path_info.path == file or file.startswith(dir_path.path)
165+
return path_info.path == fname or fname.startswith(dir_path.path)
167166

168167
def _upload(self, from_file, to_info, name=None, no_progress_bar=True):
169168
bucket = self.gs.bucket(to_info.bucket)

0 commit comments

Comments
 (0)