commit | 58d6b1b7a4f25d09991d5bf853d7c23c7545f01b | [log] [tgz] |
---|---|---|
author | Ronald Oussoren <ronaldoussoren@mac.com> | Fri May 06 11:31:33 2011 +0200 |
committer | Ronald Oussoren <ronaldoussoren@mac.com> | Fri May 06 11:31:33 2011 +0200 |
tree | 3e31c1e2a4e695bdb40928c34e65041801706c6d | |
parent | fe12aa67fc93ddc97fce2ecb856eef6545efd98b [diff] [blame] |
Backport fix for issue #10684 from 3.x
diff --git a/Lib/shutil.py b/Lib/shutil.py index f2d2a90..9d922fb 100644 --- a/Lib/shutil.py +++ b/Lib/shutil.py
@@ -277,6 +277,12 @@ """ 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