Ignore errors trying to get FTP feature set.

This commit is contained in:
Bastian Kleineidam 2011-10-18 13:10:49 +02:00
parent 74ea444a9a
commit a2978209e6
2 changed files with 10 additions and 4 deletions

View file

@ -12,6 +12,8 @@ Fixes:
Closes: SF bug #3392021
- configuration: Parse logger and logging part names case insensitive.
Closes: SF bug #3380114
- checking: Ignore errors trying to get FTP feature set.
Closes: SF bug #3424719
Features:
- checking: If a warning regex is configured, multiple matches in

View file

@ -119,10 +119,14 @@ class FtpUrl (internpaturl.InternPatternUrl, proxysupport.ProxySupport):
def negotiate_encoding (self):
"""Check if server can handle UTF-8 encoded filenames.
See also RFC 2640."""
features = self.url_connection.sendcmd("FEAT")
log.debug(LOG_CHECK, "FTP features %s", features)
if " UTF-8" in features.splitlines():
self.filename_encoding = "utf-8"
try:
features = self.url_connection.sendcmd("FEAT")
except ftplib.error_perm, msg:
log.debug(LOG_CHECK, "Ignoring error when getting FTP features: %s" % msg)
else:
log.debug(LOG_CHECK, "FTP features %s", features)
if " UTF-8" in features.splitlines():
self.filename_encoding = "utf-8"
def cwd (self):
"""