summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Forcier <jeff@bitprophet.org>2017-07-13 09:34:57 -0700
committerJeff Forcier <jeff@bitprophet.org>2017-07-13 09:34:59 -0700
commit3e505d2bb9a434de7084535532f06da048698d14 (patch)
treef52a626f54a27a8556d8b35ad8da029d9b320865
parentb8768b2a30597fad033cc8cf6fe12d6a9b9fc569 (diff)
downloadparamiko-3e505d2bb9a434de7084535532f06da048698d14.tar.gz
Enhance SFTP client & server docs re: posix_rename and its relation to rename
Fixes #1016, re #1012
-rw-r--r--paramiko/sftp_client.py7
-rw-r--r--paramiko/sftp_si.py7
2 files changed, 14 insertions, 0 deletions
diff --git a/paramiko/sftp_client.py b/paramiko/sftp_client.py
index dee0e2b2..51c02365 100644
--- a/paramiko/sftp_client.py
+++ b/paramiko/sftp_client.py
@@ -366,6 +366,11 @@ class SFTPClient(BaseSFTP, ClosingContextManager):
"""
Rename a file or folder from ``oldpath`` to ``newpath``.
+ .. note::
+ This method implements 'standard' SFTP ``RENAME`` behavior; those
+ seeking the OpenSSH "POSIX rename" extension behavior should use
+ `posix_rename`.
+
:param str oldpath:
existing name of the file or folder
:param str newpath:
@@ -392,6 +397,8 @@ class SFTPClient(BaseSFTP, ClosingContextManager):
:raises:
``IOError`` -- if ``newpath`` is a folder, posix-rename is not
supported by the server or something else goes wrong
+
+ :versionadded: 2.2
"""
oldpath = self._adjust_cwd(oldpath)
newpath = self._adjust_cwd(newpath)
diff --git a/paramiko/sftp_si.py b/paramiko/sftp_si.py
index 40969309..b43b582c 100644
--- a/paramiko/sftp_si.py
+++ b/paramiko/sftp_si.py
@@ -194,6 +194,11 @@ class SFTPServerInterface (object):
``newpath`` already exists. (The rename operation should be
non-desctructive.)
+ .. note::
+ This method implements 'standard' SFTP ``RENAME`` behavior; those
+ seeking the OpenSSH "POSIX rename" extension behavior should use
+ `posix_rename`.
+
:param str oldpath:
the requested path (relative or absolute) of the existing file.
:param str newpath: the requested new path of the file.
@@ -210,6 +215,8 @@ class SFTPServerInterface (object):
the requested path (relative or absolute) of the existing file.
:param str newpath: the requested new path of the file.
:return: an SFTP error code `int` like ``SFTP_OK``.
+
+ :versionadded: 2.2
"""
return SFTP_OP_UNSUPPORTED