New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doc/pathlib: Please describe the behaviour of Path().rename() is depends on the platform (same as os.rename()) #71367
Comments
The behavior of Path().rename() is same as os.rename() (replaces silently if dest file is already existent on Unix) but it's difficult to catch from current pathlib documentation (I found it from source of pathlib) from comparing with replace(). IMHO, it should be described on pathlilb documentation. |
*** cpythonmod/Doc/library/pathlib.rst 2016-06-07 11:29:07.200774979 -0600
--- cpython/Doc/library/pathlib.rst 2016-06-07 11:29:59.372777817 -0600
***************
*** 887,896 ****
.. method:: Path.rename(target)
! 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')
--- 887,894 ----
.. method:: Path.rename(target)
! Rename this file or directory to the given *target*. *target* can be
! either a string or another path object::
>>> p = Path('foo')
>>> p.open('w').write('some text') |
Could you please send your patch in unified diff format? See https://docs.python.org/devguide/patch.html for details. |
patch27180. LGTM. |
New changeset 270fd4493195 by Berker Peksag in branch '3.5': New changeset 89821243621b by Berker Peksag in branch 'default': |
Thanks! |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: