uvicorn icon indicating copy to clipboard operation
uvicorn copied to clipboard

Change CTRL_C_EVENT to the SIGINT signal, as PyCharm does not handle CTRL_C_EVENT signals.

Open liuyiyangwang opened this issue 1 year ago • 0 comments

Summary

Unfortunately, starting from uvicorn 0.21.1, when developing with PyCharm, reload cannot terminate the process properly. Change CTRL_C_EVENT to the SIGINT signal, as PyCharm does not handle CTRL_C_EVENT signals.

os.kill(self.process.pid, signal.CTRL_C_EVENT) -- >> os.kill(self.process.pid, signal.SIGINT)

I am certain that this is an issue with PyCharm. Unfortunately, they haven't responded to my feedback. I hope the author can make a compromise and merge this pull request, as it addresses a significant usability issue.

liuyiyangwang avatar Jan 21 '24 02:01 liuyiyangwang