Backport fix for issue #10684 from 3.x

This commit is contained in:
Ronald Oussoren 2011-05-06 11:31:33 +02:00
parent fe12aa67fc
commit 58d6b1b7a4
3 changed files with 28 additions and 0 deletions

View file

@ -277,6 +277,12 @@ def move(src, dst):
"""
real_dst = dst
if os.path.isdir(dst):
if _samefile(src, dst):
# We might be on a case insensitive filesystem,
# perform the rename anyway.
os.rename(src, dst)
return
real_dst = os.path.join(dst, _basename(src))
if os.path.exists(real_dst):
raise Error, "Destination path '%s' already exists" % real_dst