A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2007-February/070905.html below:

[Python-Dev] Adding timeout option to httplib...connect()

[Python-Dev] Adding timeout option to httplib...connect() [Python-Dev] Adding timeout option to httplib...connect()skip at pobox.com skip at pobox.com
Fri Feb 9 14:52:16 CET 2007
    Guido> I recently needed to access an HTTP URL with a timeout. I ended
    Guido> up monkey-patching httplib.HTTPConnection so that the connect()
    Guido> method has an optional second paramer, timeout, defaulting to
    Guido> None; if not None, a call to settimeout() is added right after
    Guido> successful creation of the socket.

    Guido> Does anybody else think this is a good idea?

In principle it's probably a fine idea.  We should consider if it's possible
to develop a uniform approach to timeouts for all the libraries that use
sockets though.  Otherwise you run the risk of doing it in different ways
for different libraries and having to make a (small, but annoying) semantic
leap when going from, say, httplib to smtpllib or ftplib.

Skip
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4