mirror of
https://github.com/python/cpython.git
synced 2025-08-23 10:16:01 +00:00
bpo-26791: Update shutil.move() to provide the same symlink move behavior as the mv shell when moving a symlink into a directory that is the target of the symlink (GH-21759)
This commit is contained in:
parent
1b19d73768
commit
c66b577d9f
3 changed files with 34 additions and 1 deletions
|
@ -885,7 +885,7 @@ def move(src, dst, copy_function=copy2):
|
|||
sys.audit("shutil.move", src, dst)
|
||||
real_dst = dst
|
||||
if os.path.isdir(dst):
|
||||
if _samefile(src, dst):
|
||||
if _samefile(src, dst) and not os.path.islink(src):
|
||||
# We might be on a case insensitive filesystem,
|
||||
# perform the rename anyway.
|
||||
os.rename(src, dst)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue