I've been using Pycharm for several years, and whenever I press the red 'stop' button to stop running a script, Pycharm stops gracefully with exit code -1:
However I've just installed Python and Pycharm on a new system, and despite uninstalling, reinstalling, and checking every setting is correct, when I press the red 'stop' button in Pycharm IDE to stop running a script, I get a lengthy error message which spams the output log and makes it difficult to see useful output:
Interestingly the error says that the process was interrupted by Ctrl+C, which is not the case, because when I press Ctrl+C when a script is running, the script continues to run and does not exit. Pressing the red 'stop' button in the Pycharm IDE is what causes the error.
Any idea what is causing this error? I know it's definately possible for Pycharm to exit gracefully (i.e. with an exit code -1) without me having to add additional exception code as suggested here, since this is what happens on my other device (I don't need to add any code, it just works).
I am using PyCharm 2022.1 (Community Edition), and PyCharm 2020.3.3 (Community Edition) on my other system which does not have the error. Not sure if this make a difference? Both systems are using Python 3.9.2.