[Python-Dev] python/trunk/Lib/test/test_urllib.py (for ftpwrapper)

ocean ocean at m2.ccsnet.ne.jp
Sat May 26 06:50:40 CEST 2007


# Sorry, I posted to inapropreate mailing list. (Python-3000)

http://mail.python.org/pipermail/python-checkins/2007-May/060507.html

Hello. I'm using Windows2000, I tried some investigation for
test_ftpwrapper.

After I did this change, most errors were gone.

Index: Lib/urllib.py
===================================================================
--- Lib/urllib.py (revision 55584)
+++ Lib/urllib.py (working copy)
@@ -833,7 +833,7 @@
         self.busy = 0
         self.ftp = ftplib.FTP()
         self.ftp.connect(self.host, self.port, self.timeout)
-        self.ftp.login(self.user, self.passwd)
+#        self.ftp.login(self.user, self.passwd)
         for dir in self.dirs:
             self.ftp.cwd(dir)

I don't know, but probably 'login' on Win2000 is problamatic.

Remaining error is:

  File "e:\python-dev\trunk\lib\threading.py", line 460, in __bootstrap
    self.run()
  File "e:\python-dev\trunk\lib\threading.py", line 440, in run
    self.__target(*self.__args, **self.__kwargs)
  File "test_urllib.py", line 565, in server
    conn.recv(13)
error: (10035, 'The socket operation could not complete without blocking')

And after commented out conn.recv block in test_urllib.py, test passed fine.

def server(evt):
    serv = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    serv.settimeout(3)
    serv.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
    serv.bind(("", 9093))
    serv.listen(5)
    try:
        conn, addr = serv.accept()
        conn.send("1 Hola mundo\n")
        """
        cantdata = 0
        while cantdata < 13:
            data = conn.recv(13-cantdata)
            cantdata += len(data)
            time.sleep(.3)
        """
        conn.send("2 No more lines\n")
        conn.close()
    except socket.timeout:
        pass
    finally:
        serv.close()
        evt.set()



More information about the Python-Dev mailing list