~pythonregexp2.7/python/issue2636

« back to all changes in this revision

Viewing changes to Lib/test/test_urllib2.py

  • Committer: Jeffrey C. "The TimeHorse" Jacobs
  • Date: 2008-06-09 14:36:32 UTC
  • mfrom: (39021.1.402 Regexp-2.6)
  • Revision ID: darklord@timehorse.com-20080609143632-wwwkx92u1t5l7yd3
Merged in changes from the latest python source snapshot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
from test import test_support
3
3
 
4
4
import os
 
5
import socket
5
6
import StringIO
6
7
 
7
8
import urllib2
551
552
 
552
553
        class NullFTPHandler(urllib2.FTPHandler):
553
554
            def __init__(self, data): self.data = data
554
 
            def connect_ftp(self, user, passwd, host, port, dirs, timeout=None):
 
555
            def connect_ftp(self, user, passwd, host, port, dirs,
 
556
                            timeout=socket._GLOBAL_DEFAULT_TIMEOUT):
555
557
                self.user, self.passwd = user, passwd
556
558
                self.host, self.port = host, port
557
559
                self.dirs = dirs
558
560
                self.ftpwrapper = MockFTPWrapper(self.data)
559
561
                return self.ftpwrapper
560
562
 
561
 
        import ftplib, socket
 
563
        import ftplib
562
564
        data = "rheum rhaponicum"
563
565
        h = NullFTPHandler(data)
564
566
        o = h.parent = MockOpener()
691
693
                self.req_headers = []
692
694
                self.data = None
693
695
                self.raise_on_endheaders = False
694
 
            def __call__(self, host, timeout=None):
 
696
            def __call__(self, host, timeout=socket._GLOBAL_DEFAULT_TIMEOUT):
695
697
                self.host = host
696
698
                self.timeout = timeout
697
699
                return self