[Patches] [ python-Patches-723312 ] ability to pass a timeout to underlying socket

SourceForge.net noreply at sourceforge.net
Wed Jan 12 14:52:50 CET 2005


Patches item #723312, was opened at 2003-04-17 21:03
Message generated for change (Comment added) made by gregweb
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=723312&group_id=5470

Category: Library (Lib)
Group: Python 2.3
Status: Open
Resolution: Works For Me
Priority: 6
Submitted By: Matthew Russell (mattruss)
Assigned to: Skip Montanaro (montanaro)
Summary: ability to pass a timeout to underlying socket

Initial Comment:
this patch superceeds an earlier one i posted (#714592)
 - a bit *too* enthusiastic am afraid (sorry!)

classes in modules such as  httplib, ftpplib do not
currently allow an easy way to take advantage of the
new socket timeout feature in 2.3.

This patch provides that abilty though one additonal
class in socket.py ( socket.NetworkConnection ) and
accompying test in test_socket.py (basic though the
test is :-s )

As an extra benifit, the patch removes duplicate code,
as each connect method in the main class of most
modules (FTP, HTTPConnection, Telnet, POP3 etc) are
copies of each other.

The modules that use sockets are:

    * ftplib
    * httplib 
    * telnetlib
    * poplib
    * urllib
    * imaplib
    * nntplib
    * xmlrpclib

Of these I have only been able to easily refactor
NetworkConnection into httplib, ftplib, telnetllib,
poplib and smtplib.

I did look to see if there were any unittests for
theese modules in .Lib/test but found none (? - I
appologise if there are some, i am new to the library
tests)

I did however check that the test() [like] methods at
the bottom of each of the afore mentioned modules worked.


thanks for your advice again Skip :o)
Matt



----------------------------------------------------------------------

Comment By: Grégoire Weber (gregweb)
Date: 2005-01-12 14:52

Message:
Logged In: YES 
user_id=812601

Just lobbying:

It would be nice to have that on board in futire python
versions.
Would this be possible in python 2.4.1?

I need timeouts for xmlrpclib and subclassed
xmlrpclib.Transport for my needs.

But nevertheless it would be nice to have that in python 2.4.1.
Thanks!

Gregoire

----------------------------------------------------------------------

Comment By: Matthew Russell (mattruss)
Date: 2003-04-21 01:20

Message:
Logged In: YES 
user_id=737261

Errata:
i forgot to mention urlllib2 as modules affected.

the line above starting "The modules that use sockets are: "
should really read: "classes in the modules stated below
would benifit from the ability pass timeouts:"



----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=723312&group_id=5470


More information about the Patches mailing list