Skip to content

Commit ba488d1

Browse files
committed
#7761: fix telnetlib.interact failures on Windows.
1 parent 123015e commit ba488d1

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

Lib/telnetlib.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ def mt_interact(self):
552552
line = sys.stdin.readline()
553553
if not line:
554554
break
555-
self.write(line)
555+
self.write(line.encode('ascii'))
556556

557557
def listener(self):
558558
"""Helper for mt_interact() -- this executes in the other thread."""
@@ -563,7 +563,7 @@ def listener(self):
563563
print('*** Connection closed by remote host ***')
564564
return
565565
if data:
566-
sys.stdout.write(data)
566+
sys.stdout.write(data.decode('ascii'))
567567
else:
568568
sys.stdout.flush()
569569

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ Core and Builtins
5151
Library
5252
-------
5353

54+
- #7761: telnetlib.interact failures on Windows fixed.
55+
5456
- logging: Added style option to Formatter to allow %, {} or $-formatting.
5557

5658
- Issue #5178: Added tempfile.TemporaryDirectory class that can be used

0 commit comments

Comments
 (0)