sammchardy / python-binance

Binance Exchange API python implementation for automated trading
https://python-binance.readthedocs.io/en/latest/
MIT License
6.05k stars 2.21k forks source link

Having an issue with key error. #737

Open CJNA opened 3 years ago

CJNA commented 3 years ago
Exception occured:'success'
   result = arbi_bot.binance_client.withdraw(
 File "/usr/local/lib/python3.8/site-packages/binance/client.py", line 2254, in withdraw
   if not res['success']:
KeyError: 'success'

This might not be the best place to ask, but wondering whether team saw this issue pop up. Essentially, I am seeing a response from Binance Server, with message 'success' I can see this message since my exception handler catches this and prints the exception, and raise BinanceWithdrawException(res['msg']) client raises exception with 'msg'. I am confused from Binance's API behavior here as it is sending me 'success' as message.

CJNA commented 3 years ago

Nvm. It is helpful to print out why res don't contain success, as it can just have msg. I'll put a patch that handles this

CJNA commented 3 years ago

https://github.com/sammchardy/python-binance/pull/740

Bob12345 commented 3 years ago

the key is "success", but what is the value of that key! just a shot in the dark!