YiriMiraiProject / YiriMirai

一个轻量级、低耦合的基于 mirai-api-http 的 Python SDK。
https://yiri-mirai.wybxc.cc
GNU Affero General Public License v3.0
124 stars 13 forks source link

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

Closed kressety closed 2 years ago

kressety commented 2 years ago

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 commented 2 years ago

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

crytion commented 1 year ago

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

kressety commented 1 year ago

@crytion

pip3 install websockets --upgrade

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