8000 GH-127381: pathlib ABCs: remove `PathBase.move()` and `move_into()` by barneygale · Pull Request #128337 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

GH-127381: pathlib ABCs: remove PathBase.move() and move_into() #128337

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

Merged
merged 2 commits into from
Jan 4, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
typo
  • Loading branch information
barneygale committed Dec 29, 2024
commit 240ce04469eaf8509160331a8fa4f00f274a329f
4 changes: 2 additions & 2 deletions Lib/pathlib/_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -1128,7 +1128,7 @@ def move(self, target):
"""
Recursively move this file or directory tree to the given destination.
"""
# Use os.rename() if the target is os.PathLike and on the same FS.
# Use os.replace() if the target is os.PathLike and on the same FS.
try:
target_str = os.fspath(target)
except TypeError:
Expand All @@ -1138,7 +1138,7 @@ def move(self, target):
target = self.with_segments(target_str)
target.copy._ensure_different_file(self)
try:
os.rename(self, target_str)
os.replace(self, target_str)
return target
except OSError as err:
if err.errno != EXDEV:
Expand Down
Loading
0