From 7c8b8b95b2ef96c84d9f03dc64050b9dd6f392c8 Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 31 Mar 2023 22:49:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- toolbox.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/toolbox.py b/toolbox.py index d96b3f6..be64c31 100644 --- a/toolbox.py +++ b/toolbox.py @@ -55,6 +55,10 @@ def write_results_to_file(history, file_name=None): with open(f'./gpt_log/{file_name}', 'w', encoding = 'utf8') as f: f.write('# chatGPT 分析报告\n') for i, content in enumerate(history): + try: # 这个bug没找到触发条件,暂时先这样顶一下 + if type(content) != str: content = str(content) + except: + continue if i%2==0: f.write('## ') f.write(content) f.write('\n\n')