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'
The improved
serve_forever()introduced in #1745 relies on CPython's private _serving_forever_fut attribute, which breaks compatibility withuvloop, since it utilizes its own Cython-basedServerimplementation: