LUCIT-Systems-and-Development / unicorn-binance-websocket-api

A Python SDK by LUCIT to use the Binance Websocket API`s (com+testnet, com-margin+testnet, com-isolated_margin+testnet, com-futures+testnet, com-coin_futures, us, tr, dex/chain+testnet) in a simple, fast, flexible, robust and fully-featured way.
https://unicorn-binance-websocket-api.docs.lucit.tech/
Other
688 stars 164 forks source link

throwing asyncio error messages #31

Closed mbellmbell closed 5 years ago

mbellmbell commented 5 years ago

Check this or we will delete your issue. (fill in the checkbox with an X like so: [x])

Select one:

Environment

Operating System? (include version)

Python Version Requirement

Exact Python Version?

Include here the response of 'python --version' or 'python3 --version'
Python 3.6.5

Pip Version?

Include here the response of 'pip --version' or 'pip3 --version'
pip 19.1.1 from /Users/.../python3.6/site-packages/pip (python 3.6)

Dependencies

Run `pip list > pip_list.txt pip_list.txt

` and upload the file.

UNICORN Binance WebSocket API Version?

Did you upgrade to the latest release version with `pip install unicorn-binance-websocket-api --upgrade`?
yes

Please control what version you are using with this script and post the output: https://github.com/unicorn-data-analysis/unicorn-binance-websocket-api/blob/master/tools/get_used_module_version.py
1.6.5

Description of your issue

System has been running smoothly for months. Today, I started receiving the error message below. I haven't updated any code or libraries in a few weeks. Note that Binance updated their API yesterday, including some websockets update. I tried both 7.0 and 8.0 websockets, on a Mac and Ubuntu. Same issue everywhere.

Also note that the https://github.com/sammchardy/python-binance library continues to work.

ERROR:asyncio:Task was destroyed but it is pending!
task: <Task pending coro=<WebSocketCommonProtocol.close_connection() done, defined at /Users/michaelbrill/Documents/projects/binance_realtime/env/lib/python3.6/site-packages/websockets/protocol.py:1113> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x10bb1fdf8>()]>>
GezaBoi commented 5 years ago

having the same problem. in the binance chat someone told me that trailing is no longer allowed. so:

wss://stream.binance.com:9443/stream?streams=btcusdt@depth/btcusdt@trade/  -> invalid
wss://stream.binance.com:9443/stream?streams=btcusdt@depth/btcusdt@trade  -> valid 

could you guys check that and maybe tell me how i can hotfix that?

mbellmbell commented 5 years ago

@GezaBoi I did the following (note that I just tested with my scenario, so I'm not sure what sort of mayhem it could create):

In unicorn_binance_websocket_api_manager.py

above line 638: return self.websocket_base_uri + str(query)

insert the line: query = query[:-1] Same level of indent., This will just remove the "/" at the end. Works for me.

GezaBoi commented 5 years ago

@mmm3bbb fix worked for me as well! thanks for letting me know.

@bithon this error seems easy to fix. could you update the repo?

oliver-zehentleitner commented 5 years ago

Hello! Thanks for providing the infos! I will update and test the repository asap. Best regards!

oliver-zehentleitner commented 5 years ago

Code on github is updated and tested. A new release is created and a new wheel is available on pypi!

https://github.com/unicorn-data-analysis/unicorn-binance-websocket-api/releases