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/imaplib.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/imaplib.py')
-rw-r--r-- | Lib/imaplib.py | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/Lib/imaplib.py b/Lib/imaplib.py index 04d4d87..03513a3 100644 --- a/Lib/imaplib.py +++ b/Lib/imaplib.py @@ -222,14 +222,7 @@ class IMAP4: def send(self, data): """Send data to remote.""" - bytes = len(data) - while bytes > 0: - sent = self.sock.send(data) - if sent == bytes: - break # avoid copy - data = data[sent:] - bytes = bytes - sent - + self.sock.sendall(data) def shutdown(self): """Close I/O established in "open".""" |