Skip to content

Commit 86e8bd8

Browse files
lucmosLuca Moschella
authored and
Luca Moschella
committed
Refactor the _remove_fs_prefix without using os.path.relpath
1 parent 827a7be commit 86e8bd8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fsspec/implementations/prefix.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def _remove_fs_prefix(self, path: str) -> Union[str, Sequence[str]]:
5050
if isinstance(path, (str, Path)):
5151
path = stringify_path(path)
5252
protocol, path = split_protocol(path)
53-
path = os.path.relpath(path, start=self.prefix)
53+
path = path[len(self.prefix) + 1 :]
5454
return protocol + "://" + path if protocol is not None else path
5555
elif isinstance(path, Iterable):
5656
return [self._remove_fs_prefix(x) for x in path]

0 commit comments

Comments
 (0)