From e12454f44afbb7d48aecb9d479fcb2fb4799499f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20v=2E=20L=C3=B6wis?= Date: Sat, 16 Feb 2002 23:06:19 +0000 Subject: 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. --- Lib/telnetlib.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Lib/telnetlib.py') diff --git a/Lib/telnetlib.py b/Lib/telnetlib.py index 15721c6e6f..cdbbd9f5cc 100644 --- a/Lib/telnetlib.py +++ b/Lib/telnetlib.py @@ -269,7 +269,7 @@ class Telnet: if IAC in buffer: buffer = buffer.replace(IAC, IAC+IAC) self.msg("send %s", `buffer`) - self.sock.send(buffer) + self.sock.sendall(buffer) def read_until(self, match, timeout=None): """Read until a given string is encountered or until timeout. @@ -411,7 +411,7 @@ class Telnet: if self.option_callback: self.option_callback(self.sock, c, opt) else: - self.sock.send(IAC + WONT + opt) + self.sock.sendall(IAC + WONT + opt) elif c in (WILL, WONT): opt = self.rawq_getchar() self.msg('IAC %s %d', @@ -419,7 +419,7 @@ class Telnet: if self.option_callback: self.option_callback(self.sock, c, opt) else: - self.sock.send(IAC + DONT + opt) + self.sock.sendall(IAC + DONT + opt) else: self.msg('IAC %d not recognized' % ord(opt)) except EOFError: # raised by self.rawq_getchar() -- cgit v1.2.1