python-binance icon indicating copy to clipboard operation
python-binance copied to clipboard

python-binance not working with Python 3.10?

Open chiwalfrm opened this issue 1 year ago • 1 comments

Describe the bug nothing received on websocket

To Reproduce

import asyncio
from binance import AsyncClient, BinanceSocketManager

async def main():
        client = await AsyncClient.create()
        bm = BinanceSocketManager(client)
        # start any sockets here, i.e a trade socket
        ts = bm.trade_socket('BTCUSDT')
        # then start receiving messages
        async with ts as tscm:
                while True:
                        res = await tscm.recv()
                        print(res)
        await client.close_connection()

if __name__ == "__main__":
        loop = asyncio.get_event_loop()
        loop.run_until_complete(main())

Expected behavior Essentially the line "res = await tscm.recv()" never finishes. Nothing is received.

Environment (please complete the following information):

  • Python version: 3.10.12
  • Virtual Env: [e.g. virtualenv, conda]
  • OS: Ubuntu
  • python-binance version 1.0.19

Logs or Additional context Add any other context about the problem here.

chiwalfrm avatar Jan 16 '24 20:01 chiwalfrm

I am on Python 3.10.12 and Ubuntu 22.04 python-binance version is 1.0.19 I can verify this code is working fine.

luk0y avatar Mar 04 '24 15:03 luk0y