Patch: httplib.py default timeout

Aahz Maruch aahz at netcom.com
Tue Dec 28 10:36:12 EST 1999


In article <14440.48375.677822.934000 at dolphin.mojam.com>,
Skip Montanaro  <skip at mojam.com> wrote:
>
>I understand the motivation for the timeout, but shouldn't the default be to
>not timeout at all:
>
>    defaultTimeout = 0		# wait forever
>    ...
>    def connect(self, host, port = 0, timeout = defaultTimeout):
>
>?  Although timeouts are very useful, they are hardly the norm.  Your change
>would break code that nominally works now because exceptions could get
>raised where none are expected.

Nope.  Any code that currently uses httplib *HAS* to catch exceptions or
break when the actual socket connect call fails (you'll note that the
socket options get set *after* self.sock.connect()).  See my other posts
in this thread for more info.
--
                      --- Aahz (@netcom.com)

Androgynous poly kinky vanilla queer het    <*>     http://www.rahul.net/aahz/
Hugs and backrubs -- I break Rule 6

TEOTWAWKI -- 4 days and counting!



More information about the Python-list mailing list