KeyboardInterrupt error exiting debug mode in PyCharm

I have the same problem. Ray 2.3.1. PyCharm 2021.2.3 Community Edition. Python 3.9.16. Mac OS 13.3. If I try to run ray.init() in the PyCharm debugger, it fails with

/usr/local/anaconda3/envs/lingua/bin/python "/Applications/PyCharm CE.app/Contents/plugins/python-ce/helpers/pydev/pydevd.py" --multiproc --qt-support=auto --client 127.0.0.1 --port 49909 --file /Users/bill.mcneill/Src/rayadd.py
Connected to pydev debugger (build 212.5457.59)
2023-04-14 14:04:34,463	INFO worker.py:1544 -- Started a local Ray instance. View the dashboard at 127.0.0.1:8265 
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "/usr/local/anaconda3/envs/lingua/lib/python3.9/site-packages/ray/_private/node.py", line 1220, in _kill_process_type
    self._kill_process_impl(
  File "/usr/local/anaconda3/envs/lingua/lib/python3.9/site-packages/ray/_private/node.py", line 1276, in _kill_process_impl
    process.wait(timeout_seconds)
  File "/usr/local/anaconda3/envs/lingua/lib/python3.9/subprocess.py", line 1189, in wait
    return self._wait(timeout=timeout)
  File "/usr/local/anaconda3/envs/lingua/lib/python3.9/subprocess.py", line 1911, in _wait
    time.sleep(delay)
KeyboardInterrupt

Process finished with exit code 0

More complicated Ray code fails as well. Running in PyCharm without debug is fine. Rebooting the computer does not fix the problem.

PyCharm debugging worked fine on this machine yesterday. I don’t know what has changed.