diff options
author | Ronald Oussoren <ronaldoussoren@mac.com> | 2011-05-06 11:31:33 +0200 |
---|---|---|
committer | Ronald Oussoren <ronaldoussoren@mac.com> | 2011-05-06 11:31:33 +0200 |
commit | 58d6b1b7a4f25d09991d5bf853d7c23c7545f01b (patch) | |
tree | 3e31c1e2a4e695bdb40928c34e65041801706c6d /Lib/shutil.py | |
parent | fe12aa67fc93ddc97fce2ecb856eef6545efd98b (diff) | |
download | cpython-git-58d6b1b7a4f25d09991d5bf853d7c23c7545f01b.tar.gz |
Backport fix for issue #10684 from 3.x
Diffstat (limited to 'Lib/shutil.py')
-rw-r--r-- | Lib/shutil.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/shutil.py b/Lib/shutil.py index f2d2a90a8e..9d922fbefc 100644 --- a/Lib/shutil.py +++ b/Lib/shutil.py @@ -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 |