ChenyangGao / web-mount-packs

Encapsulating web interfaces for some network disks
MIT License
230 stars 45 forks source link

P115Client报错coroutine 'ClientSession.close' was never awaited #4

Closed karma-sun closed 8 months ago

karma-sun commented 9 months ago

P115Client报错 p115__init__.py:213: RuntimeWarning: coroutine 'ClientSession.close' was never awaited 调用client.close()似乎并无效果

以下为测试代码 from p115 import P115Client client = P115Client('XXX') client.fs.chdir('/aa') client.fs.listdir_path() client.close()

ChenyangGao commented 9 months ago

P115Client报错 p115init.py:213: RuntimeWarning: coroutine 'ClientSession.close' was never awaited 调用client.close()似乎并无效果

以下为测试代码 from p115 import P115Client client = P115Client('XXX') client.fs.chdir('/aa') client.fs.listdir_path() client.close()

这不算错误,只是warning,不影响

karma-sun commented 9 months ago

P115Client报错 p115init.py:213: RuntimeWarning: coroutine 'ClientSession.close' was never awaited 调用client.close()似乎并无效果 以下为测试代码 from p115 import P115Client client = P115Client('XXX') client.fs.chdir('/aa') client.fs.listdir_path() client.close()

这不算错误,只是warning,不影响

并非毫无影响,我看了下代码,问题根源在于P115Client里你同时打开了requests和aiohttp的Session,即使我没有用async编程 aiohttp难道不是应该仅在async编程模式下用的吗

ChenyangGao commented 9 months ago

P115Client报错 p115init.py:213: RuntimeWarning: coroutine 'ClientSession.close' was never awaited 调用client.close()似乎并无效果 以下为测试代码 from p115 import P115Client client = P115Client('XXX') client.fs.chdir('/aa') client.fs.listdir_path() client.close()

这不算错误,只是warning,不影响

并非毫无影响,我看了下代码,问题根源在于P115Client里你同时打开了requests和aiohttp的Session,即使我没有用async编程 aiohttp难道不是应该仅在async编程模式下用的吗

ok,明天改

ChenyangGao commented 9 months ago

已改

karma-sun commented 8 months ago

ok