From fe248aa130c438d63309779d499fef3791f8e709 Mon Sep 17 00:00:00 2001 From: Saugat Pachhai Date: Thu, 28 Nov 2019 05:47:04 +0545 Subject: [PATCH] dvc: use replace instead of posixpath --- dvc/remote/gs.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/dvc/remote/gs.py b/dvc/remote/gs.py index aa0958bd38..882e329369 100644 --- a/dvc/remote/gs.py +++ b/dvc/remote/gs.py @@ -5,7 +5,6 @@ from functools import wraps import io import os.path -import posixpath from funcy import cached_property @@ -148,7 +147,7 @@ def list_cache_paths(self): def walk_files(self, path_info): for fname in self._list_paths(path_info.bucket, path_info.path): - yield path_info / posixpath.relpath(fname, path_info.path) + yield path_info.replace(fname) def isdir(self, path_info): dir_path = path_info / "" @@ -160,10 +159,10 @@ def isdir(self, path_info): def exists(self, path_info): dir_path = path_info / "" - file = next( + fname = next( self._list_paths(path_info.bucket, path_info.path, max_items=1), "" ) - return path_info.path == file or file.startswith(dir_path.path) + return path_info.path == fname or fname.startswith(dir_path.path) def _upload(self, from_file, to_info, name=None, no_progress_bar=True): bucket = self.gs.bucket(to_info.bucket)