Всем привет. Ранее не сталкивался с такой ошибкой. Завершаю бота кнопкой stop, а не ctrl+c как пишет консоль. Бесконечных циклов нет. Может что-то не так с
main:
async def main():
try:
await client.start()
await client.connect()
await dp.start_polling(bot)
finally:
await bot.session.close()
if __name__ == "__main__":
asyncio.run(main())
Ошибка:
Traceback (most recent call last):
File "C:\Users\ALEXE\AppData\Local\Programs\Python\Python311\Lib\asyncio\runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ALEXE\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 653, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "C:\Users\ALEXE\PycharmProjects\MY-TELEGRAM-BOT\BOT\MAIN.py", line 436, in main
await dp.start_polling(bot)
File "C:\Users\ALEXE\PycharmProjects\MY-TELEGRAM-BOT\venv\Lib\site-packages\aiogram\dispatcher\dispatcher.py", line 543, in start_polling
done, pending = await asyncio.wait(tasks, return_when=asyncio.FIRST_COMPLETED)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ALEXE\AppData\Local\Programs\Python\Python311\Lib\asyncio\tasks.py", line 418, in wait
return await _wait(fs, timeout, return_when, loop)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ALEXE\AppData\Local\Programs\Python\Python311\Lib\asyncio\tasks.py", line 525, in _wait
await waiter
asyncio.exceptions.CancelledError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\ALEXE\PycharmProjects\MY-TELEGRAM-BOT\BOT\MAIN.py", line 441, in <module>
asyncio.run(main())
File "C:\Users\ALEXE\AppData\Local\Programs\Python\Python311\Lib\asyncio\runners.py", line 190, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "C:\Users\ALEXE\AppData\Local\Programs\Python\Python311\Lib\asyncio\runners.py", line 123, in run
raise KeyboardInterrupt()
KeyboardInterrupt
Буду благодарен за любые идеи.