sammchardy / python-binance

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

ThreadedWebsocketManager #960

Open sherxon211 opened 3 years ago

sherxon211 commented 3 years ago

ERROR:asyncio:Task exception was never retrieved future: <Task finished name='Task-5' coro=<ThreadedApiManager.start_listener() done, defined at C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\binance\threaded_stream.py:42> exception=AttributeError("'Connect' object has no attribute 'protocol'")>

Environment (please complete the following information):

jchappe commented 3 years ago

I'm getting the same issue. Any help here would be appreciated!

andrehenriquemendes commented 3 years ago

Hello @sherxon211 and @jchappe, same problem here. Did you manage to solve the problem?

pouyaGit commented 2 years ago

Same Issue!

medvi commented 2 months ago

I am exploring it a little bit and found that in binance/streams.py there is somewhere code like this

        if self._conn and hasattr(self._conn, 'protocol'):
            await self._conn.__aexit__(exc_type, exc_val, exc_tb)

, but somewhere like this (no hasattr check)

        if self.ws and self._conn:
            await self._conn.__aexit__(None, None, None)

I don't know if this is still relevant for anyone or not, but keep in mind