From 2e1963ed169b764f720db0a3126fc64d34fd9dab Mon Sep 17 00:00:00 2001 From: Ekko Date: Tue, 10 May 2022 17:29:35 +0800 Subject: [PATCH] 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. --- biliup/engine/upload.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/biliup/engine/upload.py b/biliup/engine/upload.py index d537e0c..9b0dcc9 100644 --- a/biliup/engine/upload.py +++ b/biliup/engine/upload.py @@ -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