From 6edb6c48e7ac777e20abcb0e5be15903e425b436 Mon Sep 17 00:00:00 2001 From: wsh5485 Date: Wed, 15 Jan 2025 18:06:16 +0800 Subject: [PATCH] 0.0.4 --- clean_logs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clean_logs.py b/clean_logs.py index abe2ec0..ca91b51 100644 --- a/clean_logs.py +++ b/clean_logs.py @@ -13,7 +13,7 @@ def clean_log_files(directory): # 清理超过7天的日志记录 if os.path.exists(log_file): - with open(log_file, 'r+') as f: + with open(log_file, 'r+', encoding='utf-8') as f: lines = f.readlines() f.seek(0) for line in lines: