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/telnetlib.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/telnetlib.py')
-rw-r--r-- | Lib/telnetlib.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/telnetlib.py b/Lib/telnetlib.py index 15721c6..cdbbd9f 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() |