From 79b46ed533219de3d95e50271f1f87a7a38eaf87 Mon Sep 17 00:00:00 2001 From: vonweller <154695311+vonweller@users.noreply.github.com> Date: Sat, 8 Mar 2025 19:09:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=90=AF=E5=8A=A8=E6=8A=A5?= =?UTF-8?q?=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复启动时SyntaxWarning: invalid escape sequence '\]' half_width_punctuations = '!"#$%&\'()*+,-./:;<=>?@[\]^_`{|}~'的报错问题 --- main/xiaozhi-server/core/utils/util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/xiaozhi-server/core/utils/util.py b/main/xiaozhi-server/core/utils/util.py index 4bc37d286..8a8dac953 100644 --- a/main/xiaozhi-server/core/utils/util.py +++ b/main/xiaozhi-server/core/utils/util.py @@ -75,7 +75,7 @@ def get_string_no_punctuation_or_emoji(s): def remove_punctuation_and_length(text): # 全角符号和半角符号的Unicode范围 full_width_punctuations = '!"#$%&'()*+,-。/:;<=>?@[\]^_`{|}~' - half_width_punctuations = '!"#$%&\'()*+,-./:;<=>?@[\]^_`{|}~' + half_width_punctuations = r'!"#$%&\'()*+,-./:;<=>?@[\]^_`{|}~' space = ' ' # 半角空格 full_width_space = ' ' # 全角空格