]> granicus.if.org Git - python/commitdiff
#7761: fix telnetlib.interact failures on Windows.
authorR. David Murray <rdmurray@bitdance.com>
Tue, 26 Oct 2010 12:42:24 +0000 (12:42 +0000)
committerR. David Murray <rdmurray@bitdance.com>
Tue, 26 Oct 2010 12:42:24 +0000 (12:42 +0000)
Lib/telnetlib.py
Misc/NEWS

index 5258c8ad20435dac4c87b50fb651f3ea45014597..c60578debff52efde75b8afe2c9b23870475fe5b 100644 (file)
@@ -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()
 
index d9098d5307c49f5a600e51906a24956d32541197..8fb6203a89995874612095ec164b157168927d39 100644 (file)
--- 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