summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Forcier <jeff@bitprophet.org>2017-08-21 12:25:43 -0700
committerJeff Forcier <jeff@bitprophet.org>2017-08-21 12:25:43 -0700
commit5fcf88f34a6e2ea8d8c13866ca78cfd68311c274 (patch)
tree23f2a728c007f1692c7fce3df2892b62a760d11b
parent7a2449317d781e3846c5366d269226f2d30750fe (diff)
parent08f503740182608570ac87661225fe2e11914d8f (diff)
downloadparamiko-5fcf88f34a6e2ea8d8c13866ca78cfd68311c274.tar.gz
Merge branch 'master' into 531-int
-rw-r--r--paramiko/sftp_client.py7
-rw-r--r--paramiko/sftp_si.py7
-rw-r--r--sites/www/changelog.rst4
3 files changed, 18 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
diff --git a/sites/www/changelog.rst b/sites/www/changelog.rst
index dea044bf..12c8cb03 100644
--- a/sites/www/changelog.rst
+++ b/sites/www/changelog.rst
@@ -2,6 +2,10 @@
Changelog
=========
+* :support:`1012` (via :issue:`1016`) Enhance documentation around the new
+ `SFTP.posix_rename <paramiko.sftp_client.SFTPClient.posix_rename>` method so
+ it's referenced in the 'standard' ``rename`` method for increased visibility.
+ Thanks to Marius Flage for the report.
* :release:`2.2.1 <2017-06-13>`
* :bug:`993` Ed25519 host keys were not comparable/hashable, causing an
exception if such a key existed in a ``known_hosts`` file. Thanks to Oleh