-
Notifications
You must be signed in to change notification settings - Fork 362
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
Strip protocol from paths in fsspec.generic.GenericFileSystem._copy #1577
base: master
Are you sure you want to change the base?
Conversation
Seems to fix a problem.
This is probably reasonable (even given a fix in sshfs), but it would be nice if we could engineer a case that failed before this fix and now passes, as a test against regression. |
You are referencing this fix in sshfs for the This fix is to get around another problem i was having after I resolved the sshfs one above. And yeah, a breaking/fixing test case is a grand idea. I will work on that. I imagine I can use a mockssh server for this, perhaps? hmmm. fs = fsspec.url_to_fs("sftp://user@host:1234")[0]
fsspec.generic.rsync(
"sftp:///stuff",
"gs://dbucket/dir1/dir2",
inst_kwargs={"default_method": "current"},
) is what i was using locally to test this... i wonder if the existing |
memory, local and ftp FSs are the typical ones used in tests (in that order). You could make a mock, but if any of those show the problem, it would be easier. |
…col. this might have to be done in all _info and info methods; or just fix genericfilesystem somehow?
hmmm, seems like any filesystem that doesn't strip in their I decided to try this with the built in implementation of sftp instead of also was able to reproduce this in the test by commenting out the strip in the memory impl here. with that line commented out the test fails in the same way as i don't think the fix can be done in |
Yes I think all backends should be able to cope with paths with or without protocol specifiers. |
bleh, this is becoming quite tricky to test. not certain how to do it. would it be better to move this out of |
If you can state the problem as "sshfs should always use _strip_protocol, but doesn't", then yes. |
The logic in Generic changed recently, not to update the "name" field of the dircache of its target filesystems (part of #1633 ). That might be enough to fix the issue here. |
Seems to fix a problem I was having.
Can't do it upstream in the
rsync
method because at least one file needs the protocol to resolve the proper filesystem.