Skip to content

SFTPFIle breaks on prefetch, because server cannot FSTAT calls to file handles, but only STAT. #444

Closed

Description

@danverbraganza

I'm using paramiko via PySFTP to connect to a client's sftp server. The client is running WSSFTP Server by IPSwitch. I'm seeing really weird behaviour from their server, that I've traced down to the following reproducible issue:

If you call SFTPClient.stat('folder/folder/filename.txt'), the server returns the appropriate status.

If you call SFTPFile.stat(), the server gets confused, and returns:

IOError: Folder not found: D:\sftp-root\folder\folder\filename.txt

Note that the slashes have turned the wrong way now.

I have a proposed fix for this I'm going to submit as a PR. Please let me know if the paramiko philosophy is not to make these changes for compatibility with poor servers, in which case I'll drop this change.

Activity

  1. lndbrg commented on Nov 20, 2014

    @lndbrg
    Contributor

    Send it! :) If possible add new tests for the issue too.

  2. danverbraganza commented on Nov 21, 2014

    @danverbraganza
    Author

    Update: Turns out the server with the strange behaviour is WSSFTP Server by IPSwitch.

  3. bitprophet commented on Dec 15, 2014

    @bitprophet
    Member

    @danverbraganza We evaluate nonstandard platform support on a patch by patch basis; when the changes are small and fix something users can't easily work around, probably ok; when the changes are less small or otherwise higher-risk (eg they might introduce bugs in the normal use cases) we're more likely to say 'sorry'.

    Can't tell without seeing the patch though :) I don't see a PR related to this so do submit one if you like! (Or link to a gist of the diff, or paste it in here, whichever.)

  4. bitprophet commented on Apr 25, 2016

    @bitprophet
    Member

    Closing this both due to timeout & because I wonder if fixes in 1.16.x relating to prefetching (specifically, when/how it's called during regular get/put operations) may have also fixed this? Happy to reopen if more details come in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions