0

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:

enter image description here

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:

enter image description here

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.

Alan
  • 459
  • 3
  • 10
  • FYI, when you press the red stop button what's actually happening is that [a regular Python `KeyboardInterrupt` exception is thrown](https://stackoverflow.com/a/69528262) that tears down the debugger process prematurely. So I have to ask if you're testing this with a code snippet that's catching exceptions because if you are the stracktrace will get printed. Does this happen if you press the red button in a module that just has variable attributions for example? – bad_coder Apr 26 '22 at 09:12

0 Answers0