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 #49

Closed
kressety opened this issue Aug 9, 2022 · 3 comments

Comments

@kressety
Copy link

kressety commented Aug 9, 2022

  • Python: 3.10.6

INFO: Started server process [1772]
INFO: Waiting for application startup.
2022-08-09 15:47:17 - ERROR As of 3.10, the loop parameter was removed from Lock() since it is no longer necessary
ERROR: Traceback (most recent call last):
File "/usr/lib/python3.10/lib/python3.10/site-packages/starlette/routing.py", line 645, in lifespan
async with self.lifespan_context(app):
File "/usr/lib/python3.10/lib/python3.10/site-packages/starlette/routing.py", line 540, in aenter
await self._router.startup()
File "/usr/lib/python3.10/lib/python3.10/site-packages/starlette/routing.py", line 622, in startup
await handler()
File "/usr/lib/python3.10/lib/python3.10/site-packages/mirai/bot.py", line 226, in startup
await asyncio.gather(*coros)
File "/usr/lib/python3.10/lib/python3.10/site-packages/mirai/bot.py", line 135, in startup
await self._adapter.login(self.qq)
File "/usr/lib/python3.10/lib/python3.10/site-packages/mirai/adapters/base.py", line 35, in wrapped
return await func(self, *args, **kwargs)
File "/usr/lib/python3.10/lib/python3.10/site-packages/mirai/adapters/websocket.py", line 187, in login
self.connection = await connect(self.host_name, extra_headers=headers)
File "/usr/lib/python3.10/lib/python3.10/site-packages/websockets/legacy/client.py", line 622, in await_impl
transport, protocol = await self._create_connection()
File "/usr/lib/python3.10/lib/python3.10/asyncio/base_events.py", line 1089, in create_connection
transport, protocol = await self._create_connection_transport(
File "/usr/lib/python3.10/lib/python3.10/asyncio/base_events.py", line 1107, in _create_connection_transport
protocol = protocol_factory()
File "/usr/lib/python3.10/lib/python3.10/site-packages/websockets/legacy/client.py", line 160, in init
super().init(**kwargs)
File "/usr/lib/python3.10/lib/python3.10/site-packages/websockets/legacy/protocol.py", line 154, in init
self._drain_lock = asyncio.Lock(
File "/usr/lib/python3.10/lib/python3.10/asyncio/locks.py", line 78, in init
super().init(loop=loop)
File "/usr/lib/python3.10/lib/python3.10/asyncio/mixins.py", line 17, in init
raise TypeError(
TypeError: As of 3.10, the loop parameter was removed from Lock() since it is no longer necessary

ERROR: Application startup failed. Exiting.

@kressety
Copy link
Author

kressety commented Aug 9, 2022

更新websockets到最新版后即可正常运行

@kressety kressety closed this as completed Aug 9, 2022
@crytion
Copy link

crytion commented Nov 4, 2022

你好, 我的3.10.6出现同样问题, 更新websockets是怎么弄

@kressety
Copy link
Author

kressety commented Nov 4, 2022

@crytion

pip3 install websockets --upgrade

yiri-mirai自带的websockets版本过低,手动更新一下就行了

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

2 participants