[issue10684] Folders get deleted when trying to change case with shutil.move (case insensitive file systems only)
report at bugs.python.org
Tue Jan 25 06:14:28 CET 2011
Heikki Toivonen <hjtoi-bugzilla at comcast.net> added the comment:
You can't solve this by trying to do different things on different operating systems. This bug depends on file system properties, not OS.
Also I don't think you can just lower case the path and do a comparison, because there are funky characters that don't round trip lower->upper->lower. And you certainly can't do this for just the last component of the path name - any component of the path could have changed case.
I still think the best avenue would be to first try straight os.rename, and if that fails (maybe only if target exists), the logic that is currently in shutil.move.
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list