I'm on OS-X, using the flask library to make a small api.
Usually when I terminate the process with Ctrl-C it used to just raise KeyboardInterrupt
, but now it will exit with socket.error: [Errno 48] Address already in use
instead. After that, trying to restart the program throws the same error. This used to happen occasionally, but now seems to happen every time. Activity Monitor shows the Python process to still be running with 3 threads.
The fix is to quit the process from Activity Monitor.
Why does the process not get terminated properly anymore (note: I am using Ctrl-C, not Ctrl-Z), and is there a way to fix this minor inconvenience?