Skip to content

The new asyncio server_forever() implementation in 17.0 has broken compatibility with uvloop #1746

Description

@pmarcelll

The improved serve_forever() introduced in #1745 relies on CPython's private _serving_forever_fut attribute, which breaks compatibility with uvloop, since it utilizes its own Cython-based Server implementation:

  File "/home/dockeruser/.local/lib/python3.12/site-packages/websockets/asyncio/server.py", line 534, in serve_forever
    if self.server._serving_forever_fut is not None:  # type: ignore[attr-defined]
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'uvloop.loop.Server' object has no attribute '_serving_forever_fut'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions