From 157ee63b03b5ef8b0cb05c0bd4333de3d96e2b44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20v=2E=20L=C3=B6wis?= Date: Sat, 16 Feb 2002 23:06:19 +0000 Subject: The Grande 'sendall()' patch, copied from release21-maint. Fixes #516715. Replaces calls to socket.send() (which isn't guaranteed to send all data) with the new socket.sendall() method. --- Lib/ftplib.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Lib/ftplib.py') diff --git a/Lib/ftplib.py b/Lib/ftplib.py index 6234f7f21e..cad7a5b90d 100644 --- a/Lib/ftplib.py +++ b/Lib/ftplib.py @@ -168,7 +168,7 @@ class FTP: def putline(self, line): line = line + CRLF if self.debugging > 1: print '*put*', self.sanitize(line) - self.sock.send(line) + self.sock.sendall(line) # Internal: send one command to the server (through putline()) def putcmd(self, line): @@ -231,7 +231,7 @@ class FTP: tried. Instead, just send the ABOR command as OOB data.''' line = 'ABOR' + CRLF if self.debugging > 1: print '*put urgent*', self.sanitize(line) - self.sock.send(line, MSG_OOB) + self.sock.sendall(line, MSG_OOB) resp = self.getmultiline() if resp[:3] not in ('426', '226'): raise error_proto, resp @@ -417,7 +417,7 @@ class FTP: while 1: buf = fp.read(blocksize) if not buf: break - conn.send(buf) + conn.sendall(buf) conn.close() return self.voidresp() @@ -431,7 +431,7 @@ class FTP: if buf[-2:] != CRLF: if buf[-1] in CRLF: buf = buf[:-1] buf = buf + CRLF - conn.send(buf) + conn.sendall(buf) conn.close() return self.voidresp() -- cgit v1.2.1