[Python-Dev] Regarding socket timeouts in httplib
R. David Murray
rdmurray at bitdance.com
Thu Jul 1 14:16:41 CEST 2010
On Thu, 01 Jul 2010 10:33:30 +0200, Anders Sandvig <anders.sandvig at gmail.com> wrote:
> >From the top of my head, I can come up with three (four) ways of
> properly solving the issue:
>
> 1) Documenting the timeout behavior and describing the above hack in
> the httplib documentation.
>
> 2) Modify HTTPConnection.connect() to set the timeout on the socket
> object after it has been created (using the same timeout as given on
> the HTTPConnection constructor).
>
> 3) Adding (optional) timeout parameters to
> HTTPConnection.getresponse() and HTTPResponse.read() (and possibly
> other functions with the same problem).
>
> 4) A combination of 2) and 3).
>
> Any thoughts on this?
>
> BTW: Once I figure out how, I wouldn't mind submitting a patch for
> either 2), 3) or 4), but personally I don't like 1).
FYI there's an open bug about this (or at least related to it):
http://bugs.python.org/issue8595
--
R. David Murray www.bitdance.com
More information about the Python-Dev
mailing list