Ronald Oussoren <ronaldousso...@mac.com> added the comment:

The fallback to copy+remove happens because shutil.move first checks if the 
destination exists and is a directory, if so it moves the source into the 
destination, that is, given:

os.mkdir('foo')
os.mkdir('bar')

Then ``shutil.move('foo', 'bar')`` is the same as ``shutil.move('foo', 
'bar/foo')``.

On filesystems that are case insensitive this triggers for ``shutil.move('foo', 
'FOO')`` as wel, causing a call to ``os.rename('foo', 'FOO/foo')`` and that 
fails because you cannot move a folder inside itself.

The attached patch makes the test unconditional (as it should pass always when 
the filesystem is case sensitive) and checks if src and dst are the same when 
dst is a directory, in that case os.rename is called and we never try to copy.

----------
Added file: http://bugs.python.org/file21129/issue10684-py33.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue10684>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to