##Working sample code print "Start working directory listing" ftp = FTP('ftp.kernel.org') ftp.login('anonymous', 'anonymous@') ftp.set_debuglevel(2) ftp.retrlines('LIST') ftp.close print "End working directory listing" #This doesn't work, but I think it should. print "Start non-working directory listing" ftp = FTP('12.34.228.72') # connect to host, default port ftp.login('harry','potter') # the connection info has been changed to protect the innocent ftp.set_debuglevel(2) ftp.retrlines("LIST") ftp.close print processList return 0 print "End non-working directory listing" ########Lib/ftplib.py 1.74. test########## Running for day: 040805 Previous day is: 040705 X:\zeus\readwaitreports\ split_mgr.0408 12.34.228.72 c0d0r001 /log/srv/sav aqrsy s Fetching split_mgr report Start working directory listing *cmd* 'TYPE A' *put* 'TYPE A\r\n' *get* '200 Switching to ASCII mode.\r\n' *resp* '200 Switching to ASCII mode.' *cmd* 'PASV' *put* 'PASV\r\n' *get* '227 Entering Passive Mode (204,152,191,5,131,36)\r\n' *resp* '227 Entering Passive Mode (204,152,191,5,131,36)' *cmd* 'LIST' *put* 'LIST\r\n' *get* '150 Here comes the directory listing.\r\n' *resp* '150 Here comes the directory listing.' *get* '226 Directory send OK.\r\n' *resp* '226 Directory send OK.' End working directory listing Start non-working directory listing *cmd* 'TYPE A' *put* 'TYPE A\r\n' *get* '200 Type set to A.\r\n' *resp* '200 Type set to A.' *cmd* 'PASV' *put* 'PASV\r\n' *get* '227 Entering Passive Mode (12,34,228,72,197,239)\r\n' *resp* '227 Entering Passive Mode (12,34,228,72,197,239)' *cmd* 'LIST' *put* 'LIST\r\n' *get* '\n' *resp* '' Traceback (most recent call last): File "D:\Python23\lib\site-packages\PythonCard\widget.py", line 417, in _dispa tch handler(background, aWxEvent) File "D:\ReadWaitReport\readwaitreport.py", line 61, in on_btnRun_command mainRwclassLoop(self, mm+dd+yy, yesterday) File "D:\ReadWaitReport\rwclass.py", line 40, in mainRwclassLoop processList = ftpFetch(localPath,"split_mgr."+date[0:4],ftpSite,ftpPass,ftpD ir,ftpUser) File "D:\ReadWaitReport\rwclass.py", line 188, in ftpFetch ftp.retrlines("LIST", processList.append) File "D:\Python23\lib\ftplib.py", line 397, in retrlines conn = self.transfercmd(cmd) File "D:\Python23\lib\ftplib.py", line 345, in transfercmd return self.ntransfercmd(cmd, rest)[0] File "D:\Python23\lib\ftplib.py", line 327, in ntransfercmd resp = self.sendcmd(cmd) File "D:\Python23\lib\ftplib.py", line 241, in sendcmd return self.getresp() File "D:\Python23\lib\ftplib.py", line 217, in getresp raise error_proto, resp ftplib.error_proto #############2.3 distributed ftplib.py test############### Running for day: 040805 Previous day is: 040705 X:\zeus\readwaitreports\ split_mgr.0408 12.34.228.72 c0d0r001 /log/srv/sav aqrsy s Fetching split_mgr report Start working directory listing *cmd* 'TYPE A' *put* 'TYPE A\r\n' *get* '200 Switching to ASCII mode.\r\n' *resp* '200 Switching to ASCII mode.' *cmd* 'PASV' *put* 'PASV\r\n' *get* '227 Entering Passive Mode (204,152,191,5,165,204)\r\n' *resp* '227 Entering Passive Mode (204,152,191,5,165,204)' *cmd* 'LIST' *put* 'LIST\r\n' *get* '150 Here comes the directory listing.\r\n' *resp* '150 Here comes the directory listing.' drwxrwx--- 2 536 528 4096 May 21 2001 for_mirrors_only drwxrwsr-x 9 536 536 4096 Dec 26 20:25 pub lrwxrwxrwx 1 0 0 1 Apr 05 01:22 usr -> . lrwxrwxrwx 1 0 0 10 Apr 05 01:22 welcome.msg -> pub/READM E *get* '226 Directory send OK.\r\n' *resp* '226 Directory send OK.' End working directory listing Start non-working directory listing *cmd* 'TYPE A' *put* 'TYPE A\r\n' *get* '200 Type set to A.\r\n' *resp* '200 Type set to A.' *cmd* 'PASV' *put* 'PASV\r\n' *get* '227 Entering Passive Mode (12,34,228,72,83,156)\r\n' *resp* '227 Entering Passive Mode (12,34,228,72,83,156)' *cmd* 'LIST' *put* 'LIST\r\n' *get* '\n' *resp* '' Traceback (most recent call last): File "D:\Python23\lib\site-packages\PythonCard\widget.py", line 417, in _dispa tch handler(background, aWxEvent) File "D:\ReadWaitReport\readwaitreport.py", line 61, in on_btnRun_command mainRwclassLoop(self, mm+dd+yy, yesterday) File "D:\ReadWaitReport\rwclass.py", line 40, in mainRwclassLoop processList = ftpFetch(localPath,"split_mgr."+date[0:4],ftpSite,ftpPass,ftpD ir,ftpUser) File "D:\ReadWaitReport\rwclass.py", line 188, in ftpFetch ftp.retrlines("LIST") File "D:\Python23\lib\ftplib.py", line 396, in retrlines conn = self.transfercmd(cmd) File "D:\Python23\lib\ftplib.py", line 345, in transfercmd return self.ntransfercmd(cmd, rest)[0] File "D:\Python23\lib\ftplib.py", line 328, in ntransfercmd if resp[0] != '1': IndexError: string index out of range