File “/usr/local/python3/lib/python3.9/json/__init__.py”, line 359, in loads return cls(**kw).decode(s) TypeError: __init__() got an unexpected keyword argument ‘encoding’

  sre


报错:

File "/usr/local/python3/lib/python3.9/json/__init__.py", line 359, in loads
    return cls(**kw).decode(s)
TypeError: __init__() got an unexpected keyword argument 'encoding'

Python3中json.loads不需要encoding 去掉即可:

        #dict_data = json.loads(response.text, encoding="utf-8")
        dict_data = json.loads(response.text)
        # print("call_sync  === recv data : ", dict_data)

LEAVE A COMMENT

Captcha Code