1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-08-13 16:53:54 -04:00

Use shutil.move instead of os.rename to move file as os.rename doesn't

work across partition.
This commit is contained in:
Alexandre Beloin 2015-01-25 20:44:58 -05:00
parent 91cb8d885c
commit 2ef08d1c25

View File

@ -355,7 +355,7 @@ def copyFile(srcFile, destFile):
def moveFile(srcFile, destFile):
try:
ek.ek(os.rename, srcFile, destFile)
ek.ek(shutil.move, srcFile, destFile)
fixSetGroupID(destFile)
except OSError:
copyFile(srcFile, destFile)
@ -399,7 +399,7 @@ def symlink(src, dst):
def moveAndSymlinkFile(srcFile, destFile):
try:
ek.ek(os.rename, srcFile, destFile)
ek.ek(shutil.move, srcFile, destFile)
fixSetGroupID(destFile)
ek.ek(symlink, destFile, srcFile)
except:
@ -491,7 +491,7 @@ def rename_ep_file(cur_path, new_path, old_path_length=0):
# move the file
try:
logger.log(u"Renaming file from " + cur_path + " to " + new_path)
ek.ek(os.rename, cur_path, new_path)
ek.ek(shutil.move, cur_path, new_path)
except (OSError, IOError), e:
logger.log(u"Failed renaming " + cur_path + " to " + new_path + ": " + ex(e), logger.ERROR)
return False