Paramiko SFTP file renaming: OSError('Extended request not supported.')

Solution 1:

Indeed, fsspec SFTPFileSystem.mv calls Paramiko SFTPClient.posix_rename. That's imo a bad choice. The SFTPClient.posix_rename internally uses a proprietary OpenSSH [email protected] extension, which is naturally not supported by most other SFTP servers (such as yours).

I do not know what is the best solution/workaround. You can probably add your own "file system" implementation based on SFTPFileSystem, reimplementing SFTPFileSystem.mv to call standard Paramiko SFTPClient.rename (which uses standard SFTP rename request).

Solution 2:

Actually, I just found that the SFTPClient is exposed through the SFTPFileSystem and I can call rename() on it directly, which worked!

fs.ftp.rename("testfile.txt", "x")