HuobiRDCenter / huobi_Python

Python SDK for Huobi Spot API
https://huobiapi.github.io/docs/spot/v1/en
Apache License 2.0
683 stars 333 forks source link

encoding was remove in python 3.9 #137

Open thaob1d6 opened 1 year ago

thaob1d6 commented 1 year ago

I use python 3.10, what should I do to use API sdk? `

from huobi.client.account import AccountClient from huobi.constant import * from huobi.utils import LogInfo

account_client = AccountClient(api_key=g_api_key, secret_key=g_secret_key) LogInfo.output("====== (SDK encapsulated api) not recommend for low performance and frequence limitation ======") account_balance_list = account_client.get_account_balance() if account_balance_list and len(account_balance_list): for account_obj in account_balance_list: account_obj.print_object() print()

` Some error comeup TypeError: JSONDecoder.init() got an unexpected keyword argument 'encoding'

nisnevich commented 1 year ago

Still not fixed.

sharpe5 commented 2 months ago

Same issue here. This repo is completely broken if anybody uses Python 3.10 or above.

Python 3.10 was released over 3 years ago! I’m using Python 3.11.

It’s not a difficult fix:

venv/lib/python3.11/site-packages/huobi/connection/impl/restapi_invoker.py >> call_sync():

dict_data = json.loads(response.text)  # Remove parameter ‘encoding’, similarly for all other json.loads() calls.