Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: As of 3.10, the *loop* parameter was removed from Lock() since it is no longer necessary #85

Open
joncarr opened this issue Mar 21, 2023 · 0 comments

Comments

@joncarr
Copy link

joncarr commented Mar 21, 2023

I am receiving the following error. I've tried to search for a solution but it seems like the websockets maintainer is saying it's an asyncio issue and well, that repo is gone?

I've tried with Python 3.6 up to latest version with same results. The following error repeated a numerous number of times.

Is there any guidance on this issue?? I REALLY need this to work.

TypeError: As of 3.10, the *loop* parameter was removed from Lock() since it is no longer necessary
[mitmproxy-node plugin] Unexpected error: (<class 'TypeError'>, TypeError('As of 3.10, the *loop* parameter was removed from Lock() since it is no longer necessary'), <traceback object at 0x7f7da2f57e80>)
Traceback (most recent call last):
  File "/home/jec/.nvm/versions/node/v16.19.0/lib/node_modules/bleak-detector/node_modules/mitmproxy/scripts/proxy.py", line 221, in websocket_loop
    async with websockets.connect('ws://localhost:8765', max_size = None) as websocket:
  File "/home/jec/.local/lib/python3.10/site-packages/websockets/py35/client.py", line 2, in __aenter__
    return await self
  File "/home/jec/.local/lib/python3.10/site-packages/websockets/py35/client.py", line 12, in __await_impl__
    transport, protocol = await self._creating_connection
  File "/usr/lib/python3.10/asyncio/base_events.py", line 1089, in create_connection
    transport, protocol = await self._create_connection_transport(
  File "/usr/lib/python3.10/asyncio/base_events.py", line 1107, in _create_connection_transport
    protocol = protocol_factory()
  File "/home/jec/.local/lib/python3.10/site-packages/websockets/client.py", line 365, in <lambda>
    factory = lambda: create_protocol(
  File "/home/jec/.local/lib/python3.10/site-packages/websockets/client.py", line 45, in __init__
    super().__init__(**kwds)
  File "/home/jec/.local/lib/python3.10/site-packages/websockets/protocol.py", line 172, in __init__
    self._drain_lock = asyncio.Lock(loop=loop)
  File "/usr/lib/python3.10/asyncio/locks.py", line 78, in __init__
    super().__init__(loop=loop)
  File "/usr/lib/python3.10/asyncio/mixins.py", line 17, in __init__
    raise TypeError(

This is WSL on the latest kernel, btw. Really struggling to track tis one down. When I had a look at proxy.py at the loop mentioned on Line 221, I couldn't find Lock() being used.. ???

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant