From ddf7d663485c96367bf50ea5e0f9d936eb7ac217 Mon Sep 17 00:00:00 2001 From: Ryan Despain <2043940+ryaminal@users.noreply.github.com> Date: Tue, 16 Apr 2024 20:46:00 -0600 Subject: [PATCH 1/3] Strip paths in fsspec.generic.GenericFileSystem._copy Seems to fix a problem. --- fsspec/generic.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fsspec/generic.py b/fsspec/generic.py index 4fb58ac5b..9b5917848 100644 --- a/fsspec/generic.py +++ b/fsspec/generic.py @@ -348,6 +348,11 @@ async def _copy( raise NotImplementedError fs = _resolve_fs(path1[0], self.method) fs2 = _resolve_fs(path2[0], self.method) + + # strip all paths here, after resolve... + path1 = [fs._strip_protocol(p) for p in path1] + path2 = [fs2._strip_protocol(p) for p in path2] + # not expanding paths atm., assume call is from rsync() if fs is fs2: # pure remote From 44c3dfd3f97632a4eec72c33107187c625737a32 Mon Sep 17 00:00:00 2001 From: arr Date: Thu, 18 Apr 2024 10:14:16 -0600 Subject: [PATCH 2/3] fix lint on a doc... --- docs/source/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/index.rst b/docs/source/index.rst index c04d52eae..1e103fd04 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -53,7 +53,7 @@ The following libraries use ``fsspec`` internally for path and file handling: maintainable and modular data science code #. `pyxet`_, a Python library for mounting and accessing very large datasets from XetHub -#. `Huggingface🤗 Datasets`_, a popular library to +#. `Huggingface🤗 Datasets`_, a popular library to load&manipulate data for Deep Learning models ``fsspec`` filesystems are also supported by: From 59893c8778c5ab3caa59bc5377baa2564f10e331 Mon Sep 17 00:00:00 2001 From: arr Date: Fri, 19 Apr 2024 09:45:27 -0600 Subject: [PATCH 3/3] found the same problem with the non-sshfs implementation: strip protocol. this might have to be done in all _info and info methods; or just fix genericfilesystem somehow? --- fsspec/implementations/sftp.py | 1 + 1 file changed, 1 insertion(+) diff --git a/fsspec/implementations/sftp.py b/fsspec/implementations/sftp.py index 77f7b370c..5f5904890 100644 --- a/fsspec/implementations/sftp.py +++ b/fsspec/implementations/sftp.py @@ -93,6 +93,7 @@ def rmdir(self, path): self.ftp.rmdir(path) def info(self, path): + path = self._strip_protocol(path) stat = self._decode_stat(self.ftp.stat(path)) stat["name"] = path return stat