diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2002-02-16 23:06:19 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2002-02-16 23:06:19 (GMT) |
commit | e12454f44afbb7d48aecb9d479fcb2fb4799499f (patch) | |
tree | 5f67ec0019bed3aa130e25882158e6579ce5da49 /Lib/ftplib.py | |
parent | 976ade691ceef24b167c7617b50c0bd9b176e594 (diff) | |
download | cpython-e12454f44afbb7d48aecb9d479fcb2fb4799499f.zip cpython-e12454f44afbb7d48aecb9d479fcb2fb4799499f.tar.gz cpython-e12454f44afbb7d48aecb9d479fcb2fb4799499f.tar.bz2 |
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.
Diffstat (limited to 'Lib/ftplib.py')
-rw-r--r-- | Lib/ftplib.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/ftplib.py b/Lib/ftplib.py index 6234f7f..cad7a5b 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() |