summaryrefslogtreecommitdiff
path: root/Lib/smtplib.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/smtplib.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/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 cb15de202f..f024bffc1f 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')