Index: Lib/socket.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/socket.py,v retrieving revision 1.35 diff -c -r1.35 socket.py *** Lib/socket.py 22 Aug 2002 17:31:16 -0000 1.35 --- Lib/socket.py 21 Mar 2003 17:44:53 -0000 *************** *** 59,71 **** __all__.extend(os._get_exports_list(_ssl)) _realsocket = socket - _needwrapper = False if (sys.platform.lower().startswith("win") or (hasattr(os, 'uname') and os.uname()[0] == "BeOS") or sys.platform=="riscos"): - _needwrapper = True - if _have_ssl: _realssl = ssl def ssl(sock, keyfile=None, certfile=None): --- 59,68 ---- *************** *** 180,187 **** exec _s % (_m, _m, _m, _m) del _m, _s ! if _needwrapper: ! socket = SocketType = _socketobject class _fileobject(object): """Faux file object attached to a socket object.""" --- 177,183 ---- exec _s % (_m, _m, _m, _m) del _m, _s ! socket = SocketType = _socketobject class _fileobject(object): """Faux file object attached to a socket object.""" Index: Lib/test/test_urllibnet.py =================================================================== RCS file: Lib/test/test_urllibnet.py diff -N Lib/test/test_urllibnet.py *** /dev/null 1 Jan 1970 00:00:00 -0000 --- Lib/test/test_urllibnet.py 21 Mar 2003 17:44:53 -0000 *************** *** 0 **** --- 1,32 ---- + #!/usr/bin/env python + + import unittest + from test import test_support + + import socket + import urllib2 + import sys + + class URLTimeoutTest(unittest.TestCase): + + TIMEOUT = 10.0 + + def setUp(self): + socket.setdefaulttimeout(self.TIMEOUT) + + def tearDown(self): + socket.setdefaulttimeout(None) + + def testURLread(self): + f = urllib2.urlopen("http://www.python.org/") + x = f.read() + + def test_main(): + test_support.requires('network') + + suite = unittest.TestSuite() + suite.addTest(unittest.makeSuite(URLTimeoutTest)) + test_support.run_suite(suite) + + if __name__ == "__main__": + test_main()