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

File object opened via SSH is inconsistent with the file object API. Seek and write return nothing #1695

Open
mxmlnkn opened this issue Sep 28, 2024 · 2 comments · May be fixed by #1696
Open

Comments

@mxmlnkn
Copy link
Contributor

mxmlnkn commented Sep 28, 2024

This is kind of a duplicate of the paramiko issue. But, I think it could also be fixed in fsspec. I'm not sure whether fsspec does define a standard for the file object. If not, maybe it should? I find it highly unexpected that for the file object:

  • seek does not return the new position
  • write does not return the number of bytes written
  • probably other issues?

This could be fixed here instead of upstream by adding a small wrapper around the paramiko file object. Of course, the same discussion about fsspec/sshfs applies here.

@mxmlnkn mxmlnkn changed the title File object opened via SSH is inconsistent with the file object API File object opened via SSH is inconsistent with the file object API. Seek and write return nothing Sep 28, 2024
@martindurant
Copy link
Member

I'd be happy to see the file object wrapped.

the same discussion about fsspec/sshfs applies

Right, any fixes here might end up waster effort. I take it sshfs already fills out the file API?

@mxmlnkn
Copy link
Contributor Author

mxmlnkn commented Sep 29, 2024

I take it sshfs already fills out the file API?

Yes, it inherits from IOBase and then simply redirects to the asynchssh's seek and write, which are sufficiently compatible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants