Skip to content
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

Closed
hashimo mannequin opened this issue Jun 2, 2016 · 6 comments
Labels
docs Documentation in the Doc dir easy type-feature A feature request or enhancement

Comments

@hashimo
Copy link
Mannequin

hashimo mannequin commented Jun 2, 2016

BPO 27180
Nosy @vstinner, @berkerpeksag, @evelynmitchell
Files
  • patch27180
  • 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:

    assignee = None
    closed_at = <Date 2016-07-14.04:45:56.755>
    created_at = <Date 2016-06-02.11:18:19.190>
    labels = ['easy', 'type-feature', 'docs']
    title = 'Doc/pathlib: Please describe the behaviour of Path().rename()  is depends on the platform (same as os.rename())'
    updated_at = <Date 2016-07-14.04:45:56.754>
    user = 'https://bugs.python.org/hashimo'

    bugs.python.org fields:

    activity = <Date 2016-07-14.04:45:56.754>
    actor = 'berker.peksag'
    assignee = 'docs@python'
    closed = True
    closed_date = <Date 2016-07-14.04:45:56.755>
    closer = 'berker.peksag'
    components = ['Documentation']
    creation = <Date 2016-06-02.11:18:19.190>
    creator = 'hashimo'
    dependencies = []
    files = ['43289']
    hgrepos = []
    issue_num = 27180
    keywords = ['easy']
    message_count = 6.0
    messages = ['266883', '267708', '267759', '270271', '270367', '270368']
    nosy_count = 6.0
    nosy_names = ['vstinner', 'docs@python', 'python-dev', 'berker.peksag', 'hashimo', 'Evelyn Mitchell']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue27180'
    versions = ['Python 3.5', 'Python 3.6']

    @hashimo
    Copy link
    Mannequin Author

    hashimo mannequin commented Jun 2, 2016

    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.

    @hashimo hashimo mannequin assigned docspython Jun 2, 2016
    @hashimo hashimo mannequin added docs Documentation in the Doc dir type-feature A feature request or enhancement labels Jun 2, 2016
    @evelynmitchell
    Copy link
    Mannequin

    evelynmitchell mannequin commented Jun 7, 2016

    *** 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')

    @berkerpeksag
    Copy link
    Member

    Could you please send your patch in unified diff format? See https://docs.python.org/devguide/patch.html for details.

    @vstinner
    Copy link
    Member

    patch27180. LGTM.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Jul 14, 2016

    New changeset 270fd4493195 by Berker Peksag in branch '3.5':
    Issue bpo-27180: Clarify Path.rename() behavior on Unix systems
    https://hg.python.org/cpython/rev/270fd4493195

    New changeset 89821243621b by Berker Peksag in branch 'default':
    Issue bpo-27180: Merge from 3.5
    https://hg.python.org/cpython/rev/89821243621b

    @berkerpeksag
    Copy link
    Member

    Thanks!

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    docs Documentation in the Doc dir easy type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants