Traceback (most recent call last):
File "test.py", line 17, in <module>
asyncio.run(main())
File "/usr/local/lib/python3.8/asyncio/runners.py", line 43, in run
return loop.run_until_complete(main)
File "/usr/local/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
return future.result()
File "test.py", line 13, in main
await app.stop()
File "/usr/local/lib/python3.8/site-packages/pyrogram/client/client.py", line 885, in stop
await do_it()
File "/usr/local/lib/python3.8/site-packages/pyrogram/client/client.py", line 881, in do_it
await self.terminate()
File "/usr/local/lib/python3.8/site-packages/pyrogram/client/client.py", line 355, in terminate
await task
File "/usr/local/lib/python3.8/site-packages/pyrogram/client/client.py", line 1243, in download_worker
packet = await self.download_queue.get()
File "/usr/local/lib/python3.8/asyncio/queues.py", line 163, in get
await getter
RuntimeError: Task <Task pending name='Task-64' coro=<Client.download_worker() running at /usr/local/lib/python3.8/site-packages/pyrogram/client/client.py:1243>> got Future <Future pending> attached to a different loop
ERROR:asyncio:Task exception was never retrieved
future: <Task finished name='Task-63' coro=<Client.updates_worker() done, defined at /usr/local/lib/python3.8/site-packages/pyrogram/client/client.py:1291> exception=RuntimeError("Task <Task pending name='Task-63' coro=<Client.updates_worker() running at /usr/local/lib/python3.8/site-packages/pyrogram/client/client.py:1293>> got Future <Future pending> attached to a different loop")>
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/pyrogram/client/client.py", line 1293, in updates_worker
updates = await self.updates_queue.get()
File "/usr/local/lib/python3.8/asyncio/queues.py", line 163, in get
await getter
RuntimeError: Task <Task pending name='Task-63' coro=<Client.updates_worker() running at /usr/local/lib/python3.8/site-packages/pyrogram/client/client.py:1293>> got Future <Future pending> attached to a different loop
ERROR:asyncio:Task exception was never retrieved
future: <Task finished name='Task-62' coro=<Client.updates_worker() done, defined at /usr/local/lib/python3.8/site-packages/pyrogram/client/client.py:1291> exception=RuntimeError("Task <Task pending name='Task-62' coro=<Client.updates_worker() running at /usr/local/lib/python3.8/site-packages/pyrogram/client/client.py:1293>> got Future <Future pending> attached to a different loop")>
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/pyrogram/client/client.py", line 1293, in updates_worker
updates = await self.updates_queue.get()
File "/usr/local/lib/python3.8/asyncio/queues.py", line 163, in get
await getter
RuntimeError: Task <Task pending name='Task-62' coro=<Client.updates_worker() running at /usr/local/lib/python3.8/site-packages/pyrogram/client/client.py:1293>> got Future <Future pending> attached to a different loop
ERROR:asyncio:Task exception was never retrieved
future: <Task finished name='Task-61' coro=<Client.updates_worker() done, defined at /usr/local/lib/python3.8/site-packages/pyrogram/client/client.py:1291> exception=RuntimeError("Task <Task pending name='Task-61' coro=<Client.updates_worker() running at /usr/local/lib/python3.8/site-packages/pyrogram/client/client.py:1293>> got Future <Future pending> attached to a different loop")>
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/pyrogram/client/client.py", line 1293, in updates_worker
updates = await self.updates_queue.get()
File "/usr/local/lib/python3.8/asyncio/queues.py", line 163, in get
await getter
RuntimeError: Task <Task pending name='Task-61' coro=<Client.updates_worker() running at /usr/local/lib/python3.8/site-packages/pyrogram/client/client.py:1293>> got Future <Future pending> attached to a different loop
ERROR:asyncio:Task exception was never retrieved
future: <Task finished name='Task-60' coro=<Client.updates_worker() done, defined at /usr/local/lib/python3.8/site-packages/pyrogram/client/client.py:1291> exception=RuntimeError("Task <Task pending name='Task-60' coro=<Client.updates_worker() running at /usr/local/lib/python3.8/site-packages/pyrogram/client/client.py:1293>> got Future <Future pending> attached to a different loop")>
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/pyrogram/client/client.py", line 1293, in updates_worker
updates = await self.updates_queue.get()
File "/usr/local/lib/python3.8/asyncio/queues.py", line 163, in get
await getter
RuntimeError: Task <Task pending name='Task-60' coro=<Client.updates_worker() running at /usr/local/lib/python3.8/site-packages/pyrogram/client/client.py:1293>> got Future <Future pending> attached to a different loop
ERROR:asyncio:Task exception was never retrieved
future: <Task finished name='Task-67' coro=<Client.download_worker() done, defined at /usr/local/lib/python3.8/site-packages/pyrogram/client/client.py:1241> exception=RuntimeError("Task <Task pending name='Task-67' coro=<Client.download_worker() running at /usr/local/lib/python3.8/site-packages/pyrogram/client/client.py:1243>> got Future <Future pending> attached to a different loop")>
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/pyrogram/client/client.py", line 1243, in download_worker
packet = await self.download_queue.get()
File "/usr/local/lib/python3.8/asyncio/queues.py", line 163, in get
await getter
RuntimeError: Task <Task pending name='Task-67' coro=<Client.download_worker() running at /usr/local/lib/python3.8/site-packages/pyrogram/client/client.py:1243>> got Future <Future pending> attached to a different loop
ERROR:asyncio:Task exception was never retrieved
future: <Task finished name='Task-66' coro=<Client.download_worker() done, defined at /usr/local/lib/python3.8/site-packages/pyrogram/client/client.py:1241> exception=RuntimeError("Task <Task pending name='Task-66' coro=<Client.download_worker() running at /usr/local/lib/python3.8/site-packages/pyrogram/client/client.py:1243>> got Future <Future pending> attached to a different loop")>
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/pyrogram/client/client.py", line 1243, in download_worker
packet = await self.download_queue.get()
File "/usr/local/lib/python3.8/asyncio/queues.py", line 163, in get
await getter
RuntimeError: Task <Task pending name='Task-66' coro=<Client.download_worker() running at /usr/local/lib/python3.8/site-packages/pyrogram/client/client.py:1243>> got Future <Future pending> attached to a different loop
ERROR:asyncio:Task exception was never retrieved
future: <Task finished name='Task-65' coro=<Client.download_worker() done, defined at /usr/local/lib/python3.8/site-packages/pyrogram/client/client.py:1241> exception=RuntimeError("Task <Task pending name='Task-65' coro=<Client.download_worker() running at /usr/local/lib/python3.8/site-packages/pyrogram/client/client.py:1243>> got Future <Future pending> attached to a different loop")>
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/pyrogram/client/client.py", line 1243, in download_worker
packet = await self.download_queue.get()
File "/usr/local/lib/python3.8/asyncio/queues.py", line 163, in get
await getter
RuntimeError: Task <Task pending name='Task-65' coro=<Client.download_worker() running at /usr/local/lib/python3.8/site-packages/pyrogram/client/client.py:1243>> got Future <Future pending> attached to a different loop
PozitronikTech, MrBotDeveloper, neginkashkooliiis, Tao-kun, pkeorley, and Ready4FUN reacted with thumbs up emoji
Saadmairaj, greed2411, and NumeroQuadro reacted with rocket emoji
All reactions
changed the title
Stop program cause RuntimeError: Task got Future attached to a different loop (Asyncio)
Using asyncio.run() raises an error
Apr 24, 2020
@KunoiSayami Thanks, this is a known issue. asyncio.run()
is not working currently, but you can use asyncio.get_event_loop().run_until_complete(main())
or app.run(main())
.
Both will have similar functionality right? i.e it won't hinder anything else or any caveats to this approach?