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/2005-December/058998.html below:

[Python-Dev] timeout options in high-level networking modules

[Python-Dev] timeout options in high-level networking modulesSteve Holden steve at holdenweb.com
Thu Dec 22 16:52:47 CET 2005
Jim Fulton wrote:
> Yesterday, I needed to make a web request in a program (actually a test)
> that could block indefinately, so I needed to set a socket timeout.
> Unfortunately, AFAICT none of urllib, urllib2, httplib provide options to set
> the timeout on the sockets they use.  I ended up having to roll my own
> code to make the request.
> 
> It would be nice if high-level network modules, like the ones mentioned
> above, had options to provide a timeout.  (For example, urlopen could
> grow an optional timout argument.)
> 
> Thoughts?
> 
> If we think this is a good idea, then someone who has time could start chipping
> away at it.  I'm happy to work on this *if* I can find time.  This would make
> a nice easy sprint project at PyCon too.
> 
That's a very good idea. At present the only option one has is to set a 
global socket.defaulttimout() or somehow monkey-patch the modules you 
want to use, and neither of those options are entirely satisfactory.

Basically any method that can create a new TCP connection should acquire 
an optional timeout=None parameter, right?

regards
  Steve
-- 
Steve Holden       +44 150 684 7255  +1 800 494 3119
Holden Web LLC                     www.holdenweb.com
PyCon TX 2006                  www.python.org/pycon/

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