title: SocketServer never exits
body: <p>I'm starting a simple TCP server using SocketServer:</p>
  
  <pre><code>class ThreadedTCPServer(SocketServer.ThreadingMixIn, SocketServer.TCPServer):
      pass
  ...
  server = ThreadedTCPServer((HOST, PORT), ThreadedTCPRequestHandler)
  server_thread = threading.Thread(target=server.serve_forever)
  server_thread.daemon = True
  server_thread.start()
  try:
  ...
  finally:
      server.shutdown()
  </code></pre>
  
  <p>However, after the program ends <strong>it doesn't terminate and seems to be stuck</strong>. It doesn't respond to keyboard events (CTRL-C) and the only way to exit is to call <code>os._exit(0)</code> or to just close the shell window.  </p>
  
  <p>I've searched a bit about it but I still don't see what I'm missing: The thread is marked as daemon, and the server is shut-down at the end.</p>
  
  <p>I'm running Python 2.7.9 under Windows 8.1</p>