Author martin.panter
Recipients barry, martin.panter, orsenthil, serhiy.storchaka
Date 2013-12-18.02:32:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Thanks for looking at this. Perhaps you weren’t pasting the HTTP response into “socat”. After the six request lines are printed out, I enter the five lines between <HTTP response start> and <HTTP response end>; I didn’t really make this obvious. Otherwise, urlopen() hangs waiting for the response and read() never even gets called.

Here’s a Python-only HTTP server to demonstrate without needing “socat”. Run this in one terminal:

from http.server import HTTPServer, BaseHTTPRequestHandler
class Handler(BaseHTTPRequestHandler):
    protocol_version = "HTTP/1.1"
    def do_GET(self):
        self.send_header("Transfer-Encoding", "chunked")
HTTPServer(("", 8000), Handler).serve_forever()

. . . and in another terminal:

from urllib.request import urlopen
with urlopen("http://localhost:8000") as response:
import gc; gc.collect()
Date User Action Args
2013-12-18 02:32:02martin.pantersetrecipients: + martin.panter, barry, orsenthil, serhiy.storchaka
2013-12-18 02:32:01martin.pantersetmessageid: <>
2013-12-18 02:32:01martin.panterlinkissue19524 messages
2013-12-18 02:32:00martin.pantercreate