summaryrefslogtreecommitdiff
path: root/Lib/ftplib.py
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2002-02-16 23:06:19 +0000
committerMartin v. Löwis <martin@v.loewis.de>2002-02-16 23:06:19 +0000
commit157ee63b03b5ef8b0cb05c0bd4333de3d96e2b44 (patch)
treedc0987553b33517b484c54f37049b3e8f3f7f436 /Lib/ftplib.py
parentf0667f8269455cad155874eb960d5848952e5be5 (diff)
downloadcpython-157ee63b03b5ef8b0cb05c0bd4333de3d96e2b44.tar.gz
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.py8
1 files changed, 4 insertions, 4 deletions
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()