Zzaphkiel / Seraphine

英雄联盟战绩查询工具
GNU General Public License v3.0
2.29k stars 116 forks source link

[BUG] API请求失败 #410

Closed asd2422313947 closed 4 months ago

asd2422313947 commented 4 months ago

问题描述

https://github.com/Zzaphkiel/Seraphine/commit/99e713a12919aeb672d5bceadfb439669d93ec93 这个修复导致了一个API问题

系统信息

Windows 10

运行方式

在 Python 环境中直接运行源代码

软件版本

最新源代码

客户端状态(若有)

No response

复现方法(若有)

打开软件连接LOL客户端时就会触发

日志文件

import sys; print('Python %s on %s' % (sys.version, sys.platform)) C:\hj\Scripts\python.exe -X pycache_prefix=C:\Users\Administrator\AppData\Local\JetBrains\PyCharmCE2024.1\cpython-cache "F:/PyCharm Community Edition 2023.3.4/plugins/python-ce/helpers/pydev/pydevd.py" --multiprocess --qt-support=auto --client 127.0.0.1 --port 59064 --file C:\Seraphine-main\main.py 已连接到 pydev 调试器(内部版本号 241.14494.241)Task exception was never retrieved future: <Task finished name='Task-22' coro=<AuxiliaryInterface.initChampionList() done, defined at C:\Seraphine-main\app\view\auxiliary_interface.py:191> exception=RuntimeError("Task <Task pending name='Task-22' coro=<AuxiliaryInterface.initChampionList() running at C:\Seraphine-main\app\view\auxiliary_interface.py:192>> got Future attached to a different loop")> Traceback (most recent call last): File "C:\Seraphine-main\app\view\auxiliary_interface.py", line 192, in initChampionList champions = await self.autoSelectChampionCard.initChampionList() File "C:\Seraphine-main\app\view\auxiliary_interface.py", line 1340, in initChampionList self.champions = { File "C:\Seraphine-main\app\view\auxiliary_interface.py", line 1341, in i: [name, await connector.getChampionIcon(i)] File "C:\Seraphine-main\app\lol\connector.py", line 116, in wrapper raise exce File "C:\Seraphine-main\app\lol\connector.py", line 87, in wrapper async with connector.semaphore: File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38\lib\asyncio\locks.py", line 97, in aenter await self.acquire() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38\lib\asyncio\locks.py", line 496, in acquire await fut RuntimeError: Task <Task pending name='Task-22' coro=<AuxiliaryInterface.initChampionList() running at C:\Seraphine-main\app\view\auxiliary_interface.py:192>> got Future attached to a different loop Task exception was never retrieved future: <Task finished name='Task-12' coro=<CareerInterface.updateInterface() done, defined at C:\Seraphine-main\app\view\career_interface.py:377> exception=RuntimeError("Task <Task pending name='Task-16' coro=<retry..decorator..wrapper() running at C:\Seraphine-main\app\lol\connector.py:87>> got Future attached to a different loop")> Traceback (most recent call last): File "C:\Seraphine-main\app\view\career_interface.py", line 411, in updateInterface info = await parseSummonerData(summoner, rankTask, self.loadGamesTask) File "C:\Seraphine-main\app\lol\tools.py", line 162, in parseSummonerData rankInfo = await rankTask File "C:\Seraphine-main\app\lol\connector.py", line 116, in wrapper raise exce File "C:\Seraphine-main\app\lol\connector.py", line 87, in wrapper async with connector.semaphore: File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38\lib\asyncio\locks.py", line 97, in aenter await self.acquire() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38\lib\asyncio\locks.py", line 496, in acquire await fut RuntimeError: Task <Task pending name='Task-16' coro=<retry..decorator..wrapper() running at C:\Seraphine-main\app\lol\connector.py:87>> got Future attached to a different loop

您进行游戏的服务器(若有)

No response

出现率(若有)

每次这么做都必定会出现

在提交之前,请您确认

asd2422313947 commented 4 months ago

1

Zzaphkiel commented 4 months ago

无法复现,尝试一下重新安装依赖(之前某个 commit 更新了 requirements.txt

asd2422313947 commented 4 months ago

无法复现,尝试一下重新安装依赖(之前某个 commit 更新了 requirements.txt

我重新解压了项目源码,卸载重新安装了py3.8,重新配置了新的虚拟环境,重新安装了依赖,问题依旧无法解决,还是报错

asd2422313947 commented 4 months ago

无法复现,尝试一下重新安装依赖(之前某个 commit 更新了 requirements.txt

猜测应该是系统问题,我是win10,你是Win11

asd2422313947 commented 4 months ago

无法复现,尝试一下重新安装依赖(之前某个 commit 更新了 requirements.txt

建议撤销这个改动 https://github.com/Zzaphkiel/Seraphine/commit/99e713a12919aeb672d5bceadfb439669d93ec93 这个问题因系统而异,以后可能会出现和我一样的用户,届时可能会产生不少麻烦,我测试过了,信号量初始化必须在start方法里,如果放到程序初始化方法里,肯定会报错,不知道是哪里的问题,很玄学

Zzaphkiel commented 4 months ago

5380538