Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when close sockets - cannot found .fail_connection() #1478

Open
Alfavisioner opened this issue Nov 20, 2024 · 4 comments
Open

Error when close sockets - cannot found .fail_connection() #1478

Alfavisioner opened this issue Nov 20, 2024 · 4 comments
Assignees
Labels

Comments

@Alfavisioner
Copy link

Describe the bug
When try to close klines socket connection, exception is raised
AttributeError: 'ClientConnection' object has no attribute 'fail_connection'

To Reproduce
self.wsm is BinanceWebSocketManager

Stop working socket:
self.wsm.stop_socket(running_socket)

And
AttributeError: 'ClientConnection' object has no attribute 'fail_connection' is raised

from ReconnectingWebsocket:

    async def __aexit__(self, exc_type, exc_val, exc_tb):
        if self._exit_coro:
            await self._exit_coro(self._path)
        self.ws_state = WSListenerState.EXITING
        if self.ws:
            self.ws.fail_connection()

because self.ws is ClientConnection and does not have method fail_connection()
Only WebSocketCommonProtocol has that method

Expected behavior
Close socket

Environment (please complete the following information):

  • Python version: 3.13
  • OS: [Windows 10, also ubuntu]
  • python-binance version 1.0.22

Logs or Additional context
(aiohttp: 3.9.5)

@carlosmiei
Copy link
Collaborator

Hello @Alfavisioner,

Thanks for reporting, today we will release a new version that fixes this issue.

@carlosmiei carlosmiei self-assigned this Nov 20, 2024
@carlosmiei carlosmiei added the bug label Nov 20, 2024
@Alfavisioner
Copy link
Author

Thank you!

@yitech
Copy link

yitech commented Nov 23, 2024

Downgrade websockets can walkaround this:

pip uninstall websockets
pip install websockets==13.0

@carlosmiei
Copy link
Collaborator

@yitech Correct but shortly we will release a version that works with every websockets version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants