KeyboardInterrupt error exiting debug mode in PyCharm


After upgrading PyCharm from 2021.1.3 to 2022.1 (Community version) a weird issue appeared. My previously working codes which use the ray library started to throw an exception after finishing in debug mode. Normal runs return with 0, only debug mode is affected. During upgrade my config was kept.

Even this code:

import ray

results in this exception:

Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "C:\Users\user\PycharmProjects\venv\lib\site-packages\ray\_private\", line 105, in wrapper
    return func(*args, **kwargs)
  File "C:\Users\user\PycharmProjects\venv\lib\site-packages\ray\", line 1146, in shutdown

I’m using Python 3.9, ray 1.12.0 (also appeared while using 1.11.0 but still persists after upgrade) and Windows 10.

Do you have an idea what could be the cause?