When using exit(), you get an error #10

Closed
opened 2026-02-15 23:16:13 -05:00 by yindo · 2 comments
Owner

Originally created by @4444dogs on GitHub (Jul 2, 2022).

Describe the bug
When using the exit() function you get an error. (Note that the function still works, it just gives you an error)

To Reproduce

  1. Create a Command
  2. In the function for the command, add exit()
  3. Use the command in Revolt
Task exception was never retrieved
future: <Task finished name='Task-14' coro=<Client.on_message() done, defined at c:\Users\%USERNAME%\Desktop\Coding\Python\LeeBot\%USERNAME%bot.py:9> exception=SystemExit(None)>
Traceback (most recent call last):
  File "C:\Users\%USERNAME%\AppData\Local\Programs\Python\Python310\lib\asyncio\runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "C:\Users\%USERNAME%\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 633, in run_until_complete
    self.run_forever()
  File "C:\Users\%USERNAME%\AppData\Local\Programs\Python\Python310\lib\asyncio\windows_events.py", line 321, in run_forever
    super().run_forever()
  File "C:\Users\%USERNAME%\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 600, in run_forever
    self._run_once()
  File "C:\Users\%USERNAME%\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 1896, in _run_once
    handle._run()
  File "C:\Users\%USERNAME%\AppData\Local\Programs\Python\Python310\lib\asyncio\events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "c:\Users\%USERNAME%\Desktop\Coding\Python\LeeBot\%USERNAME%bot.py", line 12, in on_message
    await Client.process_commands(self, message=message)
  File "C:\Users\%USERNAME%\AppData\Local\Programs\Python\Python310\lib\site-packages\revolt\ext\commands\client.py", line 226, in process_commands
    output = await context.invoke()
  File "C:\Users\%USERNAME%\AppData\Local\Programs\Python\Python310\lib\site-packages\revolt\ext\commands\context.py", line 88, in invoke
    return await command.invoke(self, *self.args, **self.kwargs)
  File "C:\Users\%USERNAME%\AppData\Local\Programs\Python\Python310\lib\site-packages\revolt\ext\commands\command.py", line 73, in invoke
    return await self.callback(self.cog or context.client, context, *args, **kwargs)
  File "c:\Users\%USERNAME%\Desktop\Coding\Python\LeeBot\%USERNAME%bot.py", line 95, in shutdown
    exit()
  File "C:\Users\%USERNAME%\AppData\Local\Programs\Python\Python310\lib\_sitebuiltins.py", line 26, in __call__
    raise SystemExit(code)
SystemExit: None
Exception ignored in: <function _ProactorBasePipeTransport.__del__ at 0x0000020B07CFCB80>
Traceback (most recent call last):
  File "C:\Users\%USERNAME%\AppData\Local\Programs\Python\Python310\lib\asyncio\proactor_events.py", line 116, in __del__
    self.close()
  File "C:\Users\%USERNAME%\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\%USERNAME%\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 750, in call_soon
    self._check_closed()
  File "C:\Users\%USERNAME%\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 0x0000020B07CFCB80>
Traceback (most recent call last):
  File "C:\Users\%USERNAME%\AppData\Local\Programs\Python\Python310\lib\asyncio\proactor_events.py", line 116, in __del__
    self.close()
  File "C:\Users\%USERNAME%\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\%USERNAME%\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 750, in call_soon
    self._check_closed()
  File "C:\Users\%USERNAME%\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

Expected behavior
The python script should stop.

Library version

Name: revolt.py
Version: 0.1.8
Summary: Python wrapper for the revolt.chat API
Home-page: https://github.com/revoltchat/revolt.py
Author: Zomatee
Author-email: me@zomatree.live
License: MIT
Location: c:\users\lee\appdata\local\programs\python\python310\lib\site-packages
Requires: aenum, aiohttp, typing-extensions, ulid-py
Required-by:

Additional context
For anybody that doesn't know, the exit() function force stops your python script.

Originally created by @4444dogs on GitHub (Jul 2, 2022). **Describe the bug** When using the `exit()` function you get an error. (Note that the function still works, it just gives you an error) **To Reproduce** 1. Create a Command 2. In the function for the command, add `exit()` 3. Use the command in Revolt ``` Task exception was never retrieved future: <Task finished name='Task-14' coro=<Client.on_message() done, defined at c:\Users\%USERNAME%\Desktop\Coding\Python\LeeBot\%USERNAME%bot.py:9> exception=SystemExit(None)> Traceback (most recent call last): File "C:\Users\%USERNAME%\AppData\Local\Programs\Python\Python310\lib\asyncio\runners.py", line 44, in run return loop.run_until_complete(main) File "C:\Users\%USERNAME%\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 633, in run_until_complete self.run_forever() File "C:\Users\%USERNAME%\AppData\Local\Programs\Python\Python310\lib\asyncio\windows_events.py", line 321, in run_forever super().run_forever() File "C:\Users\%USERNAME%\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 600, in run_forever self._run_once() File "C:\Users\%USERNAME%\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 1896, in _run_once handle._run() File "C:\Users\%USERNAME%\AppData\Local\Programs\Python\Python310\lib\asyncio\events.py", line 80, in _run self._context.run(self._callback, *self._args) File "c:\Users\%USERNAME%\Desktop\Coding\Python\LeeBot\%USERNAME%bot.py", line 12, in on_message await Client.process_commands(self, message=message) File "C:\Users\%USERNAME%\AppData\Local\Programs\Python\Python310\lib\site-packages\revolt\ext\commands\client.py", line 226, in process_commands output = await context.invoke() File "C:\Users\%USERNAME%\AppData\Local\Programs\Python\Python310\lib\site-packages\revolt\ext\commands\context.py", line 88, in invoke return await command.invoke(self, *self.args, **self.kwargs) File "C:\Users\%USERNAME%\AppData\Local\Programs\Python\Python310\lib\site-packages\revolt\ext\commands\command.py", line 73, in invoke return await self.callback(self.cog or context.client, context, *args, **kwargs) File "c:\Users\%USERNAME%\Desktop\Coding\Python\LeeBot\%USERNAME%bot.py", line 95, in shutdown exit() File "C:\Users\%USERNAME%\AppData\Local\Programs\Python\Python310\lib\_sitebuiltins.py", line 26, in __call__ raise SystemExit(code) SystemExit: None Exception ignored in: <function _ProactorBasePipeTransport.__del__ at 0x0000020B07CFCB80> Traceback (most recent call last): File "C:\Users\%USERNAME%\AppData\Local\Programs\Python\Python310\lib\asyncio\proactor_events.py", line 116, in __del__ self.close() File "C:\Users\%USERNAME%\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\%USERNAME%\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 750, in call_soon self._check_closed() File "C:\Users\%USERNAME%\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 0x0000020B07CFCB80> Traceback (most recent call last): File "C:\Users\%USERNAME%\AppData\Local\Programs\Python\Python310\lib\asyncio\proactor_events.py", line 116, in __del__ self.close() File "C:\Users\%USERNAME%\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\%USERNAME%\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 750, in call_soon self._check_closed() File "C:\Users\%USERNAME%\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 ``` **Expected behavior** The python script should stop. **Library version** ``` Name: revolt.py Version: 0.1.8 Summary: Python wrapper for the revolt.chat API Home-page: https://github.com/revoltchat/revolt.py Author: Zomatee Author-email: me@zomatree.live License: MIT Location: c:\users\lee\appdata\local\programs\python\python310\lib\site-packages Requires: aenum, aiohttp, typing-extensions, ulid-py Required-by: ``` **Additional context** For anybody that doesn't know, the `exit()` function force stops your python script.
yindo added the unconfirmed bug label 2026-02-15 23:16:13 -05:00
yindo closed this issue 2026-02-15 23:16:13 -05:00
Author
Owner

@Zomatree commented on GitHub (Jul 2, 2022):

This is expected behaviour, you are uncleanly closing the event loop causing the error.

@Zomatree commented on GitHub (Jul 2, 2022): This is expected behaviour, you are uncleanly closing the event loop causing the error.
Author
Owner

@4444dogs commented on GitHub (Jul 2, 2022):

This is expected behaviour, you are uncleanly closing the event causing the error.

Ok, I guess that makes sense.

@4444dogs commented on GitHub (Jul 2, 2022): > This is expected behaviour, you are uncleanly closing the event causing the error. Ok, I guess that makes sense.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: stoatchat/python-client-sdk#10