[issue44788] Possibility to specify port in __init__ of ftplib.FTP

2021-07-31 Thread Marty
Marty added the comment: Well, if it's possible to connect to ftp server within __init__, I think that adding port parameter makes sense. I mostly don't need to handle connect() and login() separately. All I need is to connect to ftp server and work with it. If there is some trouble with con

[issue44788] Possibility to specify port in __init__ of ftplib.FTP

2021-07-30 Thread Jack DeVries
Jack DeVries added the comment: > user might typically want to explicitly handle them in most cases. *Explicitly handle exceptions -- ___ Python tracker ___ _

[issue44788] Possibility to specify port in __init__ of ftplib.FTP

2021-07-30 Thread Jack DeVries
Jack DeVries added the comment: The only thing to consider is that connections are flakey, and the user might typically want to explicitly handle them in most cases. Therefore, it's a better API if the .connect() call appears in the user's code. If anything, it might be better to create a ne

[issue44788] Possibility to specify port in __init__ of ftplib.FTP

2021-07-30 Thread Marty
New submission from Marty : 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, *,