This commit is contained in:
Kovid Goyal 2013-03-28 21:42:09 +05:30
parent d171a3cc5d
commit 0b9937d41d
2 changed files with 6 additions and 4 deletions

View File

@ -951,6 +951,7 @@ class DB(object):
if samefile(dest, path):
# Ensure that the file has the same case as dest
try:
if path != dest:
os.rename(path, dest)
except:
pass # Nothing too catastrophic happened, the cases mismatch, that's all
@ -964,7 +965,7 @@ class DB(object):
dest.flush()
elif dest:
if samefile(dest, path):
if not self.is_case_sensitive:
if not self.is_case_sensitive and path != dest:
# Ensure that the file has the same case as dest
try:
os.rename(path, dest)

View File

@ -1347,6 +1347,7 @@ class LibraryDatabase2(LibraryDatabase, SchemaUpgrade, CustomColumns):
if samefile(path, dest):
# Ensure that the file has the same case as dest
try:
if path != dest:
os.rename(path, dest)
except:
pass # Nothing too catastrophic happened, the cases mismatch, that's all
@ -1360,7 +1361,7 @@ class LibraryDatabase2(LibraryDatabase, SchemaUpgrade, CustomColumns):
dest.flush()
elif dest:
if samefile(dest, path):
if not self.is_case_sensitive:
if not self.is_case_sensitive and path != dest:
# Ensure that the file has the same case as dest
try:
os.rename(path, dest)