From 7a8555bdaad5e6ed6fd1e9af817b7efc0cb11137 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Fri, 29 Jul 2016 23:03:02 +0300 Subject: [PATCH] Fix py3 compatibility: ftp port must be 0, not None --- m_lib/net/ftp/ftpscan.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/m_lib/net/ftp/ftpscan.py b/m_lib/net/ftp/ftpscan.py index 51c92f3..f23e7ac 100755 --- a/m_lib/net/ftp/ftpscan.py +++ b/m_lib/net/ftp/ftpscan.py @@ -61,7 +61,7 @@ class ReconnectingFTPCallWrapper: class ReconnectingFTPWrapper: ReconnectingFTPCallWrapperClass = ReconnectingFTPCallWrapper - def __init__(self, ftp, ftp_server, ftp_port=None, login=None, password=None, ftp_dir='/', tree=None): + def __init__(self, ftp, ftp_server, ftp_port=0, login=None, password=None, ftp_dir='/', tree=None): self._ftp = ftp self._ftp_server = ftp_server self._ftp_port = ftp_port @@ -121,7 +121,7 @@ def _traverse_ftp(ftp, tree, ftp_dir): ftp.cwd("..") -def ftpscan1(ftp_server, ftp_port=None, login=None, password=None, +def ftpscan1(ftp_server, ftp_port=0, login=None, password=None, ftp_dir='/', passive=None, FTPClass=ftplib.FTP, reconnect=False, ReconnectingFTPWrapperClass=ReconnectingFTPWrapper): """Recursive FTP scan using one-by-one directory traversing. It is slow @@ -144,7 +144,7 @@ def ftpscan1(ftp_server, ftp_port=None, login=None, password=None, return tree -def ftpscanrecursive(ftp_server, ftp_port=None, login=None, password=None, +def ftpscanrecursive(ftp_server, ftp_port=0, login=None, password=None, ftp_dir='/', passive=None, FTPClass=ftplib.FTP, reconnect=False): """ Recursive FTP scan using fast LIST -R command. Not all servers supports @@ -198,7 +198,7 @@ def ftpscanrecursive(ftp_server, ftp_port=None, login=None, password=None, return tree -def ftpscan(ftp_server, ftp_port=None, login=None, password=None, +def ftpscan(ftp_server, ftp_port=0, login=None, password=None, ftp_dir='/', passive=None, FTPClass=ftplib.FTP): try: return ftpscanrecursive(ftp_server, ftp_port, login, password, ftp_dir, passive, FTPClass) -- 2.39.5