[Python-checkins] cpython (3.5): Issue #27180: Clarify Path.rename() behavior on Unix systems

berker.peksag python-checkins at python.org
Thu Jul 14 00:45:00 EDT 2016


https://hg.python.org/cpython/rev/270fd4493195
changeset:   102348:270fd4493195
branch:      3.5
parent:      102346:453a88a41a58
user:        Berker Peksag <berker.peksag at gmail.com>
date:        Thu Jul 14 07:44:59 2016 +0300
summary:
  Issue #27180: Clarify Path.rename() behavior on Unix systems

Patch by Evelyn Mitchell.

files:
  Doc/library/pathlib.rst |  5 +++--
  1 files changed, 3 insertions(+), 2 deletions(-)


diff --git a/Doc/library/pathlib.rst b/Doc/library/pathlib.rst
--- a/Doc/library/pathlib.rst
+++ b/Doc/library/pathlib.rst
@@ -891,8 +891,9 @@
 
 .. method:: Path.rename(target)
 
-   Rename this file or directory to the given *target*.  *target* can be
-   either a string or another path object::
+   Rename this file or directory to the given *target*.  On Unix, if
+   *target* exists and is a file, it will be replaced silently if the user
+   has permission.  *target* can be either a string or another path object::
 
       >>> p = Path('foo')
       >>> p.open('w').write('some text')

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list