From 7cd4d0828db788dbb141765edeab362fb3d88f03 Mon Sep 17 00:00:00 2001 From: David Wilson Date: Mon, 10 Sep 2018 01:23:29 +0100 Subject: [PATCH] tests: data/fakessh.py 3.x fixes. --- tests/data/fakessh.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/data/fakessh.py b/tests/data/fakessh.py index 69d47339..8df5aa39 100755 --- a/tests/data/fakessh.py +++ b/tests/data/fakessh.py @@ -17,22 +17,22 @@ HOST_KEY_STRICT_MSG = """Host key verification failed.\n""" def tty(msg): - fp = open('/dev/tty', 'w', 0) - fp.write(msg) + fp = open('/dev/tty', 'wb', 0) + fp.write(msg.encode()) fp.close() def stderr(msg): - fp = open('/dev/stderr', 'w', 0) - fp.write(msg) + fp = open('/dev/stderr', 'wb', 0) + fp.write(msg.encode()) fp.close() def confirm(msg): tty(msg) - fp = open('/dev/tty', 'r', 0) + fp = open('/dev/tty', 'rb', 0) try: - return fp.readline() + return fp.readline().decode() finally: fp.close()