宝塔用_7888 发表于 2023-10-27 18:47:49

【待反馈】bad escape \w at position

本帖最后由 堡塔运维小林 于 2023-10-27 19:35 编辑

面板、插件版本:7.9.0
系统版本:Windows Server 2022 Datacenter (build 20348) x64 (Py3.8.6)
问题描述:已有站点添加域名
相关截图(日志、错误):REQUEST_DATE: 2023-10-27 18:42:57 PAN_VERSION: 7.9.0
OS_VERSION: Windows Server 2022 Datacenter (build 20348) x64 (Py3.8.6)
REMOTE_ADDR: <hidden>
REQUEST_URI: POST /site?action=AddDomain
REQUEST_FORM: {'domain': 'm.bbs.域名.com', 'webname': 'bbs.域名.com', 'id': '17'}
USER_AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36 Edg/118.0.2088.69
Traceback (most recent call last):
File "C:\Program Files\python\lib\sre_parse.py", line 1039, in parse_template
    this = chr(ESCAPES)
KeyError: '\\w'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\BtSoft\panel\BTPanel\__init__.py", line 1581, in publicObject
    return run_exec().run(toObject, defs, get)
File "C:\BtSoft\panel\BTPanel\__init__.py", line 1813, in run
    result = eval(fun)
File "", line 1, in
File "C:\BtSoft\panel/class\panelSite.py", line 1198, in AddDomain
    self.ApacheDomain(get)
File "C:\BtSoft\panel/class\panelSite.py", line 1271, in ApacheDomain
    conf = re.sub(repV, myconf, conf);
File "C:\Program Files\python\lib\re.py", line 210, in sub
    return _compile(pattern, flags).sub(repl, string, count)
File "C:\Program Files\python\lib\re.py", line 327, in _subx
    template = _compile_repl(template, pattern)
File "C:\Program Files\python\lib\re.py", line 318, in _compile_repl
    return sre_parse.parse_template(repl, pattern)
File "C:\Program Files\python\lib\sre_parse.py", line 1042, in parse_template
    raise s.error('bad escape %s' % this, len(this))
re.error: bad escape \w at position 1685 (line 56, column 30)

宝塔用_7888 发表于 2023-10-27 18:49:16

修复面板无法解决问题

运维小林q3030251644 发表于 2023-10-27 19:35:10

您好,您可以尝试先修复一下面板,然后再尝试前面的操作看是否可行;
如果不行,可能是面板依赖的python环境损坏了,先停止宝塔面板,然后将下面这个目录删掉
C:\Program Files\python
然后下载这个包覆盖安装一下看看是否能解决,覆盖安装不影响原来数据与正在运行的网站。
http://download.bt.cn/win/panel/BtSoft.zip

堡塔运维南一 发表于 2024-3-6 09:21:43

问题解决了吗
页: [1]
查看完整版本: 【待反馈】bad escape \w at position