use move replace rename

os.rename only works if source and destination are on the same file system, when use cosfs, the source and destination will not on the same file system, use move instead.
This commit is contained in:
Ekko authored and GitHub committed 2022-05-10 17:29:35 +08:00
1 parent 365de47402
commit 2e1963ed16
1 file changed
+1 -1
+1 -1
View File
@@ -47,7 +47,7 @@ class UploadBase:
return False
for f in file_list:
if f.endswith('.part'):
os.rename(f, os.path.splitext(f)[0])
shutil.move(f, os.path.splitext(f)[0])
logger.info('%s存在已更名' % f)
return True