You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
你好 麻烦想请教一下如下问题
1、报错提示 raise JSONDecodeError("Expecting value", s, err.value) from None
File "D:\工作\cangqiong-scratch-master\main.py", line 29, in get
return json.loads(res.content.decode())
File "C:\Users\ChunshengDing\AppData\Local\Programs\Python\Python39\lib\json_init_.py", line 346, in loads
return _default_decoder.decode(s)
File "C:\Users\ChunshengDing\AppData\Local\Programs\Python\Python39\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Users\ChunshengDing\AppData\Local\Programs\Python\Python39\lib\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)
2、报错代码位置
def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.
This can be used to decode a JSON document from a string that may
have extraneous data at the end.
"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
raise JSONDecodeError("Expecting value", s, err.value) from None # 在这里报错
return obj, end
The text was updated successfully, but these errors were encountered:
你好 麻烦想请教一下如下问题
1、报错提示 raise JSONDecodeError("Expecting value", s, err.value) from None
File "D:\工作\cangqiong-scratch-master\main.py", line 29, in get
return json.loads(res.content.decode())
File "C:\Users\ChunshengDing\AppData\Local\Programs\Python\Python39\lib\json_init_.py", line 346, in loads
return _default_decoder.decode(s)
File "C:\Users\ChunshengDing\AppData\Local\Programs\Python\Python39\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Users\ChunshengDing\AppData\Local\Programs\Python\Python39\lib\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)
2、报错代码位置
def raw_decode(self, s, idx=0):
"""Decode a JSON document from
s
(astr
beginning witha JSON document) and return a 2-tuple of the Python
representation and the index in
s
where the document ended.The text was updated successfully, but these errors were encountered: