backtest_python icon indicating copy to clipboard operation
backtest_python copied to clipboard

报错json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)的解决方法

Open yufin opened this issue 5 years ago • 1 comments

把原来的json_loads function改为如下即可。 def json_loads(s): if s.decode('utf-8') == '': return {} if isPython3: return json.loads(s.decode('utf-8')) return json.loads(s)

yufin avatar Oct 03 '20 10:10 yufin

重新排版下

def json_loads(s):
    if s.decode('utf-8') == '':
        return {}
    if isPython3:
        return json.loads(s.decode('utf-8'))
    return json.loads(s)

gdshen avatar Jan 19 '21 14:01 gdshen