Skip to content

bpo-31163: Added return values to pathlib.Path instance's rename and replace methods.#13582

Merged
jaraco merged 2 commits into
python:masterfrom
shangdahao:issue-31163
Sep 11, 2019
Merged

bpo-31163: Added return values to pathlib.Path instance's rename and replace methods.#13582
jaraco merged 2 commits into
python:masterfrom
shangdahao:issue-31163

Conversation

@shangdahao

@shangdahao shangdahao commented May 26, 2019

Copy link
Copy Markdown
Contributor

After a rename/replace the Path instance keeps "pointing" to the previous path, and does not return the new path, which is a little misunderstand. This patch make Path instance's rename and replace methods return the new Path instance.

https://bugs.python.org/issue31163

Comment thread Doc/library/pathlib.rst
@asvetlov
asvetlov requested a review from pitrou May 29, 2019 11:44
@asvetlov

Copy link
Copy Markdown
Contributor

I'd like to get @pitrou review for pathlib changes.

@jaraco
jaraco removed the request for review from pitrou September 11, 2019 13:16

@jaraco jaraco left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Antoine is no longer reviewing pathlib, but I agree the approach here seems reasonable as does @brettcannon.

Comment thread Doc/library/pathlib.rst
@pitrou

pitrou commented Sep 11, 2019

Copy link
Copy Markdown
Member

Antoine is no longer reviewing pathlib

Not entirely true, but I don't mind other people reviewing anyway :-)

@pitrou

pitrou commented Sep 11, 2019

Copy link
Copy Markdown
Member

Sounds fine on the principle, in any case.

@jaraco
jaraco merged commit 088a09a into python:master Sep 11, 2019
@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @shangdahao for the PR, and @jaraco for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 11, 2019
…replace methods. (pythonGH-13582)

* bpo-31163: Added return values to pathlib.Path instance's rename and replace methods.
(cherry picked from commit 088a09a)

Co-authored-by: hui shang <shangdahao@gmail.com>
@bedevere-bot

Copy link
Copy Markdown

GH-15944 is a backport of this pull request to the 3.8 branch.

jaraco pushed a commit that referenced this pull request Sep 11, 2019
…replace methods. (GH-13582) (GH-15944)

* bpo-31163: Added return values to pathlib.Path instance's rename and replace methods.
(cherry picked from commit 088a09a)

Co-authored-by: hui shang <shangdahao@gmail.com>
DinoV pushed a commit to DinoV/cpython that referenced this pull request Sep 12, 2019
…replace methods. (pythonGH-13582)

* bpo-31163: Added return values to pathlib.Path instance's rename and replace methods.
websurfer5 pushed a commit to websurfer5/cpython that referenced this pull request Jul 20, 2020
…replace methods. (pythonGH-13582)

* bpo-31163: Added return values to pathlib.Path instance's rename and replace methods.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants