]> granicus.if.org Git - python/commitdiff
Merged revisions 85846 via svnmerge from
authorR. David Murray <rdmurray@bitdance.com>
Tue, 26 Oct 2010 12:47:19 +0000 (12:47 +0000)
committerR. David Murray <rdmurray@bitdance.com>
Tue, 26 Oct 2010 12:47:19 +0000 (12:47 +0000)
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r85846 | r.david.murray | 2010-10-26 08:42:24 -0400 (Tue, 26 Oct 2010) | 2 lines

  #7761: fix telnetlib.interact failures on Windows.
........

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 ed84a5eae4b5143aa7c1ded060f8da741b27342f..0b43d198f1623001011c51f70f956ca8f14d993b 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -137,6 +137,8 @@ C-API
 Library
 -------
 
+- #7761: telnetlib.interact failures on Windows fixed.
+
 - Issue #5117: Case normalization was needed on ntpath.relpath(). And
   fixed root directory issue on posixpath.relpath(). (Ported working fixes
   from ntpath)