Python socket program taking forever to run
Your program runs well on my MAC OS Mavericks (aka 10.9.5) with Python 2.7.5
It prints:

HTTP/1.1 200 OK
Date: Sun, 27 Mar 2016 07:42:22 GMT
Server: Apache
Last-Modified: Fri, 04 Dec 2015 19:05:04 GMT
ETag: "e103c2f4-a7-526172f5b5d89"
Accept-Ranges: bytes
Content-Length: 167
Cache-Control: max-age=604800, public
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: origin, x-requested-with, content-type
Access-Control-Allow-Methods: GET
Connection: close
Content-Type: text/plain

But soft what light through yonder window breaks
It is the east and Juliet is the sun
Arise fai
r sun and kill the envious moon
Who is already sick and pale with grief


I guess your program stuck while no answer was available within the TCP protocol time-out (either the server not responding or the link failing). If you want to avoid such case, you may put the "recv" statement in a separate thread and break after a time-out.
I found much help for this in this page: eli.thegreenplace.net/2011/05/18/code-sample-socket-client-thread-in-python/

Hope this helps.