From: R. David Murray Date: Tue, 26 Oct 2010 12:42:24 +0000 (+0000) Subject: #7761: fix telnetlib.interact failures on Windows. X-Git-Tag: v3.2a4~344 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ba488d150492aa6ded31da7b055cd85a152dd611;p=thirdparty%2FPython%2Fcpython.git #7761: fix telnetlib.interact failures on Windows. --- diff --git a/Lib/telnetlib.py b/Lib/telnetlib.py index 5258c8ad2043..c60578debff5 100644 --- a/Lib/telnetlib.py +++ b/Lib/telnetlib.py @@ -552,7 +552,7 @@ class Telnet: line = sys.stdin.readline() if not line: break - self.write(line) + self.write(line.encode('ascii')) def listener(self): """Helper for mt_interact() -- this executes in the other thread.""" @@ -563,7 +563,7 @@ class Telnet: print('*** Connection closed by remote host ***') return if data: - sys.stdout.write(data) + sys.stdout.write(data.decode('ascii')) else: sys.stdout.flush() diff --git a/Misc/NEWS b/Misc/NEWS index d9098d5307c4..8fb6203a8999 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -51,6 +51,8 @@ Core and Builtins Library ------- +- #7761: telnetlib.interact failures on Windows fixed. + - logging: Added style option to Formatter to allow %, {} or $-formatting. - Issue #5178: Added tempfile.TemporaryDirectory class that can be used