Skip to content

Conversation

sasano8
Copy link
Contributor

@sasano8 sasano8 commented Dec 7, 2023

In SFTPFileSystem, there is a difference in the behavior of mkdir and mkdirs.
mkdirs converts relative paths to absolute paths.

The code to reproduce is below.

import fsspec

fs = fsspec.filesystem(
    "ssh",
    host="localhost",
    port=9200,
    username="root",
    password="pass"
)

fs.mkdir("test_dir1")  # /root/test_dir1
fs.mkdirs("test_dir2")  # /test_dir2

I've pushed code that addresses this issue.

… of creating directories with absolute paths
@sasano8 sasano8 changed the title fix SFTPFileSystem.makedirs to properly handle relative paths Fix SFTPFileSystem.makedirs to properly handle relative paths Dec 7, 2023
@martindurant
Copy link
Member

I don't think I really realised we supported relative paths at all :)

Thanks for this.

@martindurant martindurant merged commit 30e479b into fsspec:master Dec 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants