opentele icon indicating copy to clipboard operation
opentele copied to clipboard

RuntimeError: Event loop is closed

Open drdoof2019 opened this issue 2 years ago • 5 comments

Hello, I am using ".session to tdata" feature. But it gives error:

Traceback (most recent call last):
  File "C:\Users\honur\AppData\Local\Programs\Python\Python310\lib\asyncio\proactor_events.py", line 116, in __del__
    self.close()
  File "C:\Users\honur\AppData\Local\Programs\Python\Python310\lib\asyncio\proactor_events.py", line 108, in close
    self._loop.call_soon(self._call_connection_lost, None)
  File "C:\Users\honur\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 750, in call_soon
    self._check_closed()
  File "C:\Users\honur\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 515, in _check_closed
    raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed
Exception ignored in: <function _ProactorBasePipeTransport.__del__ at 0x0000019F5C6B1CF0>
Traceback (most recent call last):
  File "C:\Users\honur\AppData\Local\Programs\Python\Python310\lib\asyncio\proactor_events.py", line 116, in __del__
    self.close()
  File "C:\Users\honur\AppData\Local\Programs\Python\Python310\lib\asyncio\proactor_events.py", line 108, in close
    self._loop.call_soon(self._call_connection_lost, None)
  File "C:\Users\honur\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 750, in call_soon
    self._check_closed()
  File "C:\Users\honur\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 515, in _check_closed
    raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed

I think its something about async but could not figure it out. Can you help?

drdoof2019 avatar Jun 15 '22 15:06 drdoof2019

same

luanon404 avatar Jun 16 '22 16:06 luanon404

same

Nathan6103 avatar Aug 22 '22 16:08 Nathan6103

This can be solve by adding asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())

jhemmmm avatar Oct 14 '22 11:10 jhemmmm

Where should I write?

t421050 avatar Nov 23 '22 13:11 t421050

Where should I write?

before asyncio.run() in other words - before starting the program

whatislove14 avatar Nov 30 '22 00:11 whatislove14