lbryio / lbryio/lbry-sdk

Python 3.10: wait_for() got an unexpected keyword argument 'loop'

Open
#3,736 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
7.2k
Forks
493
PR merge metrics
No merged PRs in 30d

Description

On Python 3.10

NB: I add to switch to latest 'cffi==1.15.1' to complete the pip installation with 3.10
NB: INSTALL file mentions a Python<3.8 restriction due to #2769 which was actually assumed solved (as the latest comments indicate).

2023-11-15 00:09:58,173 WARNING  lbry.extras.daemon.components:563: upnp discovery failed: wait_for() got an unexpected keyword argument 'loop'
2023-11-15 00:09:58,173 ERROR    lbry.extras.daemon.components:654: failed to setup upnp
Task exception was never retrieved
future: <Task finished name='Task-14' coro=<Gateway._discover_gateway() done, defined at /lbrydseed/lbry-sdk/lbry-venv/lib/python3.10/site-packages/aioupnp/gateway.py:197> exception=UPnPError(TypeError('As of 3.10, the *loop* parameter was removed from Event() since it is no longer necessary'))>
Traceback (most recent call last):
  File "/lbrydseed/lbry-sdk/lbry-venv/lib/python3.10/site-packages/aioupnp/protocols/ssdp.py", line 141, in listen_ssdp
    listen_result: Tuple[asyncio.BaseTransport, asyncio.BaseProtocol] = await loop.create_datagram_endpoint(
  File "/usr/lib/python3.10/asyncio/base_events.py", line 1387, in create_datagram_endpoint
    protocol = protocol_factory()
  File "/lbrydseed/lbry-sdk/lbry-venv/lib/python3.10/site-packages/aioupnp/protocols/ssdp.py", line 142, in <lambda>
    lambda: SSDPProtocol(SSDP_IP_ADDRESS, lan_address), sock=sock
  File "/lbrydseed/lbry-sdk/lbry-venv/lib/python3.10/site-packages/aioupnp/protocols/ssdp.py", line 34, in __init__
    self.connected = asyncio.Event(loop=self.loop)
  File "/usr/lib/python3.10/asyncio/locks.py", line 168, in __init__
    super().__init__(loop=loop)
  File "/usr/lib/python3.10/asyncio/mixins.py", line 17, in __init__
    raise TypeError(
TypeError: As of 3.10, the *loop* parameter was removed from Event() since it is no longer necessary

Other Python 3.10 limitations:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with INSTALL.md and the UPnP discovery traceback in aioupnp/gateway.py and aioupnp/protocols/ssdp.py; review the linked aioupnp pull request 30 for Python 3.10 compatibility. Done means installation succeeds on Python 3.10 and UPnP setup no longer fails because asyncio receives a removed loop argument.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.