Skip to content

Commit 0487a4a

Browse files
authored
Fix some encoding problems with python3.
1 parent 4158f1e commit 0487a4a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Exscript/protocols/protocol.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1142,7 +1142,7 @@ def _open_posix_shell(self,
11421142
handle_window_size):
11431143
# We need to make sure to use an unbuffered stdin, else multi-byte
11441144
# chars (such as arrow keys) won't work properly.
1145-
with os.fdopen(sys.stdin.fileno(), 'r', 0) as stdin:
1145+
with os.fdopen(sys.stdin.fileno(), 'rb', 0) as stdin:
11461146
oldtty = termios.tcgetattr(stdin)
11471147

11481148
# Update the terminal size whenever the size changes.
@@ -1196,7 +1196,7 @@ def handle_sigwinch(signum, frame):
11961196
if not is_handled:
11971197
if not self.send_data is None:
11981198
self.send_data.write(data)
1199-
channel.send(data)
1199+
channel.send(data.encode(self.encoding))
12001200
finally:
12011201
termios.tcsetattr(stdin, termios.TCSADRAIN, oldtty)
12021202

0 commit comments

Comments
 (0)