Failure to execute on Python 3.10: loop parameter was removed from asyncio.wait_for
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 26
- Forks
- 6
- PR merge metrics
- No merged PRs in 30d
Description
$ aioupnp get_external_ip
Task exception was never retrieved
future: <Task finished name='Task-2' coro=<Gateway._discover_gateway() done, defined at /media/Paulo/home/.local/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 "/media/Paulo/home/.local/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 1373, in create_datagram_endpoint
protocol = protocol_factory()
File "/media/Paulo/home/.local/lib/python3.10/site-packages/aioupnp/protocols/ssdp.py", line 142, in <lambda>
lambda: SSDPProtocol(SSDP_IP_ADDRESS, lan_address), sock=sock
File "/media/Paulo/home/.local/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
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/media/Paulo/home/.local/lib/python3.10/site-packages/aioupnp/gateway.py", line 201, in _discover_gateway
ssdp_proto = await multi_m_search(
File "/media/Paulo/home/.local/lib/python3.10/site-packages/aioupnp/protocols/ssdp.py", line 171, in multi_m_search
protocol, gateway_address, lan_address = await listen_ssdp(
File "/media/Paulo/home/.local/lib/python3.10/site-packages/aioupnp/protocols/ssdp.py", line 147, in listen_ssdp
raise UPnPError(err)
aioupnp.fault.UPnPError: As of 3.10, the *loop* parameter was removed from Event() since it is no longer necessary
Traceback (most recent call last):
File "/media/Paulo/home//.local/bin/aioupnp", line 8, in <module>
sys.exit(main())
File "/media/Paulo/home/.local/lib/python3.10/site-packages/aioupnp/__main__.py", line 117, in main
run_cli(
File "/media/Paulo/home/.local/lib/python3.10/site-packages/aioupnp/upnp.py", line 434, in run_cli
loop.run_until_complete(wrapper())
File "/usr/lib/python3.10/asyncio/base_events.py", line 646, in run_until_complete
return future.result()
File "/media/Paulo/home/.local/lib/python3.10/site-packages/aioupnp/upnp.py", line 410, in wrapper
u = await UPnP.discover(
File "/media/Paulo/home/.local/lib/python3.10/site-packages/aioupnp/upnp.py", line 56, in discover
gateway = await Gateway.discover_gateway(
File "/media/Paulo/home/.local/lib/python3.10/site-packages/aioupnp/gateway.py", line 225, in discover_gateway
return await asyncio.wait_for(loop.create_task(
TypeError: wait_for() got an unexpected keyword argument 'loop'
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with aioupnp/protocols/ssdp.py and aioupnp/gateway.py, where the traceback shows asyncio.Event and asyncio.wait_for being called with loop arguments. Reproduce the failure with the aioupnp get_external_ip command on Python 3.10, then verify that gateway discovery completes without the reported TypeError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 38/100