You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
evgfilim1 opened this issue
Mar 15, 2022
· 4 comments
Labels
2.xIssue or PR for legacy 2.x version3.xIssue or PR for stable 3.x versionbugSomething is wrong with the frameworkconfirmedThis issue is confirmed and requires actionupstreamSomething not on our side
Exception ignored in: <function _ProactorBasePipeTransport.__del__ at 0x00000207916D4040>
Traceback (most recent call last):
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\asyncio\proactor_events.py", line 116, in __del__
self.close()
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\asyncio\proactor_events.py", line 108, in close
self._loop.call_soon(self._call_connection_lost, None)
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 746, in call_soon
self._check_closed()
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 510, in _check_closed
raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed
Failure Information (for bugs)
Steps to Reproduce
importasynciofromaiogramimportBotTOKEN=""# put your token hereCHAT_ID=0# put your user ID hereasyncdefmain():
bot=Bot(TOKEN)
awaitbot.send_message(CHAT_ID, "Hello there!")
awaitbot.session.close() # replace with `await bot.close()` on 2.x# await asyncio.sleep(0.1)if__name__=='__main__':
asyncio.run(main())
If you uncomment sleep method, it works fine and finishes without traceback. I guess the problem is in aiohttp. The message is delivered anyway, with or without sleep
The text was updated successfully, but these errors were encountered:
evgfilim1
changed the title
Simply sending a message raises RuntimeError: Event loop is closed
Simple script that sends a message raises RuntimeError: Event loop is closedMar 15, 2022
evgfilim1
changed the title
Simple script that sends a message raises RuntimeError: Event loop is closed
Simple script that sends a message raises RuntimeError: Event loop is closed on Windows
Mar 15, 2022
2.xIssue or PR for legacy 2.x version3.xIssue or PR for stable 3.x versionbugSomething is wrong with the frameworkconfirmedThis issue is confirmed and requires actionupstreamSomething not on our side
Context
Expected Behavior
Process finishes gracefully
Current Behavior
Failure Information (for bugs)
Steps to Reproduce
If you uncomment
sleep
method, it works fine and finishes without traceback. I guess the problem is in aiohttp.The message is delivered anyway, with or without
sleep
The text was updated successfully, but these errors were encountered: