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

SourceForge.net noreply@sourceforge.net
Thu, 17 Apr 2003 12:10:12 -0700


Patches item #723312, was opened at 2003-04-17 20:03
Message generated for change (Settings changed) made by mattruss
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



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

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