From d57e5368382a99d74354d97be220527654d620f2 Mon Sep 17 00:00:00 2001 From: xaoyaoo Date: Tue, 5 Mar 2024 16:54:13 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E9=AB=98=E9=A2=91=E4=BD=BF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pywxdump/wx_info/merge_db.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pywxdump/wx_info/merge_db.py b/pywxdump/wx_info/merge_db.py index 8b20b54..e68c5b7 100644 --- a/pywxdump/wx_info/merge_db.py +++ b/pywxdump/wx_info/merge_db.py @@ -6,6 +6,7 @@ # Date: 2023/12/03 # ------------------------------------------------------------------------------- import os +import random import shutil import sqlite3 import time @@ -350,11 +351,11 @@ def merge_real_time_db(key, db_path: str, merge_path: str, CreateTime: int = 0, if platform.architecture()[0] != '64bit': raise Exception("System is not 64-bit.") - if not os.path.exists(db_path): raise FileNotFoundError("数据库不存在") - out_path = "tmp_real_time.db" + out_path = "tmp_" + ''.join( + random.choices('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789', k=6)) + ".db" if os.path.exists(out_path): os.remove(out_path)