Index: Lib/test/test_ftplib.py =================================================================== --- Lib/test/test_ftplib.py (revision 66669) +++ Lib/test/test_ftplib.py (working copy) @@ -212,7 +212,12 @@ def handle_accept(self): conn, addr = self.accept() self.handler = self.handler(conn) + self.close() + def handle_connect(self): + self.close() + handle_read = handle_connect + def writable(self): return 0