New submission from Marty <vpjtqwv0...@gmail.com>:
I think all that's needed is to add new parameter port in __init__ and then add it to self.connect() as argument: def __init__(self, host='', port=0, user='', passwd='', acct='', timeout=_GLOBAL_DEFAULT_TIMEOUT, source_address=None, *, encoding='utf-8'): self.encoding = encoding self.source_address = source_address self.timeout = timeout if host: self.connect(host, port) if user: self.login(user, passwd, acct) Currently if I need to specify port, I have to do it like this: with FTP() as ftp: ftp.connect(host, port) ftp.login(user, password) # my actions I the port parameter would be added, I could use it like this: with FTP(host, port, user, password) as ftp: # my actions Thank you. ---------- components: Library (Lib) messages: 398611 nosy: vpjtqwv0101 priority: normal severity: normal status: open title: Possibility to specify port in __init__ of ftplib.FTP type: enhancement versions: Python 3.9 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue44788> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com