Message131277
So, it turned out to be more complicated than that. The HTTPConnection object returns an HTTPResponse, but never closes the underlying socket after calling makesock.
Since persistent connections aren't supported, nothing actually closes the socket itself, it's just set to None. Explicitly calling a close turns out not to be correct either.
I went down the same path as AbstractHTTPHandler and added a Connection: close header. That ensures that the remote host will close the underlying connection (more importantly, setting the HTTP Response object's will_close to True). That ensures HTTPConnection performs in a "fire and forget" mode, causing everything to close out as it should.
I contemplated changing urlretrieve to use build_opener as urlopen does, but I figure that would have been done by now if it was a trivial operation. I'd be happy to take a whack at it if it's just a matter of getting around to it. |
|
Date |
User |
Action |
Args |
2011-03-17 18:30:51 | mcjeff | set | recipients:
+ mcjeff, brett.cannon, orsenthil |
2011-03-17 18:30:50 | mcjeff | set | messageid: <1300386650.82.0.0778699225107.issue11563@psf.upfronthosting.co.za> |
2011-03-17 18:30:47 | mcjeff | link | issue11563 messages |
2011-03-17 18:30:47 | mcjeff | create | |
|