ignore empty filenames in filelist

git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@2097 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
calvin 2004-12-07 08:16:20 +00:00
parent 0d9627c259
commit 9829268533

View file

@ -123,19 +123,20 @@ class FtpUrl (urlbase.UrlBase, proxysupport.ProxySupport):
def listfile (self):
"""see if filename is in the current FTP directory"""
if not self.filename:
return
files = self.get_files()
linkcheck.log.debug(linkcheck.LOG_CHECK, "FTP files %s", str(files))
if self.filename:
if self.filename in files:
# file found
return
# it could be a directory if the trailing slash was forgotten
if "%s/" % self.filename in files:
if not self.url.endswith('/'):
self.add_warning(
_("Missing trailing directory slash in ftp url."))
self.url += '/'
return
if self.filename in files:
# file found
return
# it could be a directory if the trailing slash was forgotten
if "%s/" % self.filename in files:
if not self.url.endswith('/'):
self.add_warning(
_("Missing trailing directory slash in ftp url."))
self.url += '/'
return
raise ftplib.error_perm, "550 File not found"
def get_files (self):