python-websockets in Jammy isn't entirely compatible with Python 3.10

Bug #2017704 reported by Sergio Durigan Junior
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
websockets
Fix Released
Unknown
python-websockets (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

While investigating something else (https://bugs.launchpad.net/ubuntu/+source/squid/+bug/2017460), I noticed that the python-websockets version we're carrying on Jammy is too old for Python 3.10. This is easily reproducible:

# cat > ws-server.py << __EOF__
#!/usr/bin/env python3

import asyncio
import websockets

async def handle(websocket):
    async for message in websocket:
        print(f"Received message: {message}")
        await websocket.send(f"Echoing back message: {message}")

async def main():
    async with websockets.serve(handle, "localhost", 8765):
        await asyncio.Future()

asyncio.run(main())
__EOF__
# python3 ws-server.py

In another terminal:

# python3 -m websockets ws://localhost:8765
Failed to connect to ws://localhost:8765: As of 3.10, the *loop* parameter was removed from Lock() since it is no longer necessary.

# apt policy python3-websockets
python3-websockets:
  Installed: 9.1-1
  Candidate: 9.1-1
  Version table:
 *** 9.1-1 500
        500 http://archive.ubuntu.com/ubuntu jammy/universe amd64 Packages
        100 /var/lib/dpkg/status

Changed in websockets:
status: Unknown → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in python-websockets (Ubuntu):
status: New → Confirmed
Revision history for this message
Malcolm Scott (malcscott) wrote :

The fix is in lunar and kinetic:

python-websockets (10.2-1) unstable; urgency=medium

  * New upstream release
    - supports Python 3.10 (closes: 1008598)

 -- Piotr Ożarowski <email address hidden> Tue, 29 Mar 2022 11:52:05 +0200

Any chance of a backport to jammy? The package in jammy is unusable as it's not compatible with jammy's python.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.