[ftputil] Ftputil and ftp.sunfreeware.com
MailingList SVR
lists at svrinformatica.it
Tue Apr 28 10:20:53 CEST 2009
Hi Stefan,
ftp.sunfreeware.com need another parser I think:
ftp> ls
227 Entering Passive Mode (66,193,208,66,41,119)
150 Opening ASCII mode data connection for /bin/ls.
total 10
lrwxrwxrwx 1 staff 7 Aug 13 2003 bin -> usr/bin
d--x--x--x 2 staff 512 Sep 24 2000 dev
d--x--x--x 3 staff 512 Sep 25 2000 etc
dr-xr-xr-x 3 staff 512 Oct 3 2000 pub
d--x--x--x 5 staff 512 Oct 3 2000 usr
226 Transfer complete.
conn=ftputil.FTPHost('ftp.sunfreeware.com','anonymous','pippo at pippo.com')
In [6]: conn
Out[6]: <FtpManager.ftputil.ftputil.FTPHost object at 0x1ad3610>
In [7]: conn.listdir('/')
---------------------------------------------------------------------------
ParserError Traceback (most recent call last)
/home/nicola/workspace/FtpManager/<ipython console> in <module>()
/home/nicola/workspace/FtpManager/ftputil/ftputil.py in listdir(self, path)
764 any of the available parsers raise a `ParserError`.
765 """
--> 766 return self._stat.listdir(path)
767
768 def lstat(self, path, _exception_for_missing_path=True):
/home/nicola/workspace/FtpManager/ftputil/ftp_stat.py in listdir(self, path)
533
534 def listdir(self, path):
--> 535 return self.__call_with_parser_retry(self._real_listdir, path)
536
537 def lstat(self, path, _exception_for_missing_path=True):
/home/nicola/workspace/FtpManager/ftputil/ftp_stat.py in __call_with_parser_retry(self, method, *args, **kwargs)
528 self._allow_parser_switching = False
529 self._parser = MSParser()
--> 530 return method(*args, **kwargs)
531 else:
532 raise
/home/nicola/workspace/FtpManager/ftputil/ftp_stat.py in _real_listdir(self, path)
397 # correct timestamp values in the cache
398 stat_result = self._parser.parse_line(line,
--> 399 self._host.time_shift())
400 loop_path = self._path.join(path, stat_result._st_name)
401 self._lstat_cache[loop_path] = stat_result
/home/nicola/workspace/FtpManager/ftputil/ftp_stat.py in parse_line(self, line, time_shift)
327 st_size = int(dir_or_size)
328 except ValueError:
--> 329 raise ftp_error.ParserError("invalid size %s" % dir_or_size)
330 else:
331 st_size = None
ParserError: invalid size staff
do you have something already done?
regards
Nicola
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://codespeak.net/pipermail/ftputil/attachments/20090428/4236a670/attachment.htm
More information about the ftputil
mailing list