From 2f3aeb79766b3f2f1b018a159f67ab8a7147d72e Mon Sep 17 00:00:00 2001 From: iluem <57590186+Qhaoduoyu@users.noreply.github.com> Date: Sun, 14 Apr 2024 21:51:03 +0800 Subject: [PATCH] Merge pull request from GHSA-23cr-v6pm-j89p * Update crazy_utils.py Improve security * add a white space --------- Co-authored-by: binary-husky <96192199+binary-husky@users.noreply.github.com> --- crazy_functions/crazy_utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crazy_functions/crazy_utils.py b/crazy_functions/crazy_utils.py index 980ec35..7bf79bf 100644 --- a/crazy_functions/crazy_utils.py +++ b/crazy_functions/crazy_utils.py @@ -592,7 +592,8 @@ class nougat_interface(): yield from update_ui_lastest_msg("正在解析论文, 请稍候。进度:正在加载NOUGAT... (提示:首次运行需要花费较长时间下载NOUGAT参数)", chatbot=chatbot, history=history, delay=0) - self.nougat_with_timeout(f'nougat --out "{os.path.abspath(dst)}" "{os.path.abspath(fp)}"', os.getcwd(), timeout=3600) + command = ['nougat', '--out', os.path.abspath(dst), os.path.abspath(fp)] + self.nougat_with_timeout(command, cwd=os.getcwd(), timeout=3600) res = glob.glob(os.path.join(dst,'*.mmd')) if len(res) == 0: self.threadLock.release()