Skip to content

AttributeError: module 'aiohttp' has no attribute 'ClientWSTimeout' with aiohttp 3.10.11 #425

@jamesemg

Description

@jamesemg

Describe the bug
AttributeError: module 'aiohttp' has no attribute 'ClientWSTimeout' when using aiohttp
3.10.11. The ClientWSTimeout attribute was removed from aiohttp in newer versions, causing
websocket connections to fail.

Complete error:
File "/usr/local/lib/python3.8/dist-packages/engineio/async_client.py", line 333, in _connect_websocket
File "/usr/local/lib/python3.8/dist-packages/aiohttp/init.py", line 260, in getattr
AttributeError: module aiohttp has no attribute ClientWSTimeout

To Reproduce

  1. Install aiohttp 3.10.11: pip install aiohttp==3.10.11
  2. Try to establish websocket connection using engineio async client
  3. Connection attempt fails with AttributeError

Expected behavior
Websocket connection should establish successfully with current aiohttp versions.

Logs
Failed to connect to https://example.com:5000
Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/engineio/async_client.py", line 333, in _connect_websocket
File "/usr/local/lib/python3.8/dist-packages/aiohttp/init.py", line 260, in getattr
AttributeError: module aiohttp has no attribute ClientWSTimeout

(URL anonymized for privacy)

Additional context

  • Python 3.8
  • Workaround: Downgrading to aiohttp==3.8.6 resolves the issue
  • ClientWSTimeout was deprecated and removed from aiohttp around v3.9+
  • Need compatibility with current aiohttp versions or documented version constraints

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions