This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ronaldoussoren
Recipients brian.curtin, heikki, nadeem.vawda, nooB, orsenthil, ronaldoussoren, tarek, tim.golden
Date 2011-03-14.19:31:03
SpamBayes Score 1.0344366e-09
Marked as misclassified No
Message-id <1300131068.41.0.962906968045.issue10684@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2011-03-14 19:31:08ronaldoussorensetrecipients: + ronaldoussoren, orsenthil, tim.golden, nadeem.vawda, heikki, tarek, brian.curtin, nooB
2011-03-14 19:31:08ronaldoussorensetmessageid: <1300131068.41.0.962906968045.issue10684@psf.upfronthosting.co.za>
2011-03-14 19:31:03ronaldoussorenlinkissue10684 messages
2011-03-14 19:31:03ronaldoussorencreate