mmpy_bot
mmpy_bot copied to clipboard
Click decorated functions exit on --help
Since click
is designed to wrap commands, some instructions, such as --help
, trigger a system exit.
If a sufficiently high number of requests is made, all threads will eventually be exhausted and the bot will stop responding.
How To Reproduce
- Decorate a function with
@click.command
- Send
command --help
and see the thread die withclick.exceptions.Exit: 0
.
Expected behavior
--help
should not trigger a system exit or kill the thread.
In general, worker threads should not die if an exception is raised.
Operating Environment (please complete the following information):
- OS: Linux
- Python Version: 3.9
- mmpy_bot Version: 2.0 - git
Ah nice catch, I've run into this before in other projects. It's a fairly easy fix I think, we can just catch a specific exception
I have the same trouble