宝塔用户_icqnub 发表于 2023-7-26 18:40:30

【已解答】TypeError: the JSON object must be str, bytes or bytearray, not b

REQUEST_DATE: 2023-07-26 18:38:32
PAN_VERSION: 8.0.0
OS_VERSION: CentOS7.9.2009 x86_64(Py3.7.9)
REMOTE_ADDR: 192.168.2.100
REQUEST_URI: POST /ajax?action=get_pay_type
REQUEST_FORM: {}
USER_AGENT: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36
Traceback (most recent call last):
File "class/ajax.py", line 1794, in get_pay_type
    data = json.loads(public.readFile("data/pay_type.json"))
File "/www/server/panel/pyenv/lib/python3.7/json/__init__.py", line 348, in loads
    return _default_decoder.decode(s)
File "/www/server/panel/pyenv/lib/python3.7/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/www/server/panel/pyenv/lib/python3.7/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/www/server/panel/BTPanel/__init__.py", line 2016, in publicObject
    res = run_obj.run(toObject, defs, get)
File "/www/server/panel/BTPanel/__init__.py", line 1963, in run
    result = getattr(toObject, get.action)(get)
File "class/ajax.py", line 1798, in get_pay_type
    data = json.loads(public.readFile("data/pay_type.json"))
File "/www/server/panel/pyenv/lib/python3.7/json/__init__.py", line 341, in loads
    raise TypeError(f'the JSON object must be str, bytes or bytearray, '
TypeError: the JSON object must be str, bytes or bytearray, not bool
很抱歉,面板运行时意外发生错误,请尝试按以下顺序尝试解除此错误:修复方案一:在[首页]右上角点击修复面板,并退出面板重新登录。修复方案二:如上述尝试未能解除此错误,请截图此窗口到宝塔论坛发贴寻求帮助, 论坛地址:https://www.bt.cn/bbs

盏尽 发表于 2023-7-26 20:03:13

您好,您将更新到8.0.1版本,已经针对这个问题做过修复了

宝塔用户_icqnub 发表于 2023-7-27 09:29:14

点更新没有反应,

weisoc 发表于 2023-8-4 20:43:43

同样报错,试了点击修复和更新都没什么反应
页: [1]
查看完整版本: 【已解答】TypeError: the JSON object must be str, bytes or bytearray, not b