Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix SFTPFileSystem.makedirs to properly handle relative paths #1451

Merged
merged 1 commit into from
Dec 7, 2023

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
10 checks passed
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