cpython: 051190230254 (original) (raw)

Mercurial > cpython

changeset 69872:051190230254 2.7

Backport fix for issue #10684 from 3.x [#10684]

Ronald Oussoren ronaldoussoren@mac.com
date Fri, 06 May 2011 11:31:33 +0200
parents 76a2354aa427
children a0147a1f1776
files Lib/shutil.py Lib/test/test_shutil.py Misc/NEWS
diffstat 3 files changed, 28 insertions(+), 0 deletions(-)[+] [-] Lib/shutil.py 6 Lib/test/test_shutil.py 18 Misc/NEWS 4

line wrap: on

line diff

--- a/Lib/shutil.py +++ b/Lib/shutil.py @@ -277,6 +277,12 @@ def move(src, dst): """ real_dst = dst if os.path.isdir(dst):

+ real_dst = os.path.join(dst, _basename(src)) if os.path.exists(real_dst): raise Error, "Destination path '%s' already exists" % real_dst

--- a/Lib/test/test_shutil.py +++ b/Lib/test/test_shutil.py @@ -805,6 +805,24 @@ class TestCopyFile(unittest.TestCase): self.assertTrue(srcfile._exited_with[0] is None) self.assertTrue(srcfile._raised)

+

+

+ + def test_main(): test_support.run_unittest(TestShutil, TestMove, TestCopyFile)

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -77,6 +77,10 @@ Core and Builtins Library ------- +- Issue #10684: shutil.move used to delete a folder on case insensitive