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:
1 file changed
+1
-1
@@ -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
|
||||
|
||||
|
||||
Reference in new issue
Block a user