diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2002-02-16 23:06:19 +0000 |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2002-02-16 23:06:19 +0000 |
commit | 157ee63b03b5ef8b0cb05c0bd4333de3d96e2b44 (patch) | |
tree | dc0987553b33517b484c54f37049b3e8f3f7f436 /Lib/smtplib.py | |
parent | f0667f8269455cad155874eb960d5848952e5be5 (diff) | |
download | cpython-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-x | Lib/smtplib.py | 4 |
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') |