--- /usr/lib/python2.5/ftplib.py 2006-10-06 10:24:44.000000000 -0500 +++ ./ftplib.py 2007-05-26 08:16:38.000000000 -0500 @@ -325,15 +325,21 @@ if rest is not None: self.sendcmd("REST %s" % rest) resp = self.sendcmd(cmd) - if resp[0] != '1': - raise error_reply, resp + if resp[:3] != '226': + if resp[0] == '2': + resp = self.getresp() + if resp[0] != '1': + raise error_reply, resp else: sock = self.makeport() if rest is not None: self.sendcmd("REST %s" % rest) resp = self.sendcmd(cmd) - if resp[0] != '1': - raise error_reply, resp + if resp[:3] != '226': + if resp[0] == '2': + resp = self.getresp() + if resp[0] != '1': + raise error_reply, resp conn, sockaddr = sock.accept() if resp[:3] == '150': # this is conditional in case we received a 125