diff --git a/Lib/ftplib.py b/Lib/ftplib.py index ea3f99617dc..c8eb078ba39 100644 --- a/Lib/ftplib.py +++ b/Lib/ftplib.py @@ -237,7 +237,7 @@ def abort(self): if self.debugging > 1: print('*put urgent*', self.sanitize(line)) self.sock.sendall(line, MSG_OOB) resp = self.getmultiline() - if resp[:3] not in ('426', '226'): + if resp[:3] not in ('426', '225', '226'): raise error_proto(resp) def sendcmd(self, cmd): diff --git a/Misc/NEWS b/Misc/NEWS index 89e2bf65af7..5b08d19d639 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -315,6 +315,9 @@ C-API Library ------- +- Issue #3817: ftplib.FTP.abort() method now considers 225 a valid response + code as stated in RFC-959 at chapter 5.4. + - Issue #8394: _ctypes.dlopen() accepts bytes, bytearray and str with surrogates.