summaryrefslogtreecommitdiffstats
path: root/Lib/smtplib.py
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2002-02-16 23:06:19 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2002-02-16 23:06:19 (GMT)
commite12454f44afbb7d48aecb9d479fcb2fb4799499f (patch)
tree5f67ec0019bed3aa130e25882158e6579ce5da49 /Lib/smtplib.py
parent976ade691ceef24b167c7617b50c0bd9b176e594 (diff)
downloadcpython-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/smtplib.py')
-rwxr-xr-xLib/smtplib.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/Lib/smtplib.py b/Lib/smtplib.py
index cb15de2..f024bff 100755
--- a/Lib/smtplib.py
+++ b/Lib/smtplib.py
@@ -290,9 +290,7 @@ class SMTP:
if self.debuglevel > 0: print 'send:', `str`
if self.sock:
try:
- sendptr = 0
- while sendptr < len(str):
- sendptr = sendptr + self.sock.send(str[sendptr:])
+ self.sock.sendall(str)
except socket.error:
self.close()
raise SMTPServerDisconnected('Server not connected')