Skip to content

Commit

Permalink
Fix some encoding problems with python3.
Browse files Browse the repository at this point in the history
  • Loading branch information
bigmars86 committed Aug 21, 2023
1 parent 4158f1e commit 0487a4a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Exscript/protocols/protocol.py
Expand Up @@ -1142,7 +1142,7 @@ def _open_posix_shell(self,
handle_window_size):
# We need to make sure to use an unbuffered stdin, else multi-byte
# chars (such as arrow keys) won't work properly.
with os.fdopen(sys.stdin.fileno(), 'r', 0) as stdin:
with os.fdopen(sys.stdin.fileno(), 'rb', 0) as stdin:
oldtty = termios.tcgetattr(stdin)

# Update the terminal size whenever the size changes.
Expand Down Expand Up @@ -1196,7 +1196,7 @@ def handle_sigwinch(signum, frame):
if not is_handled:
if not self.send_data is None:
self.send_data.write(data)
channel.send(data)
channel.send(data.encode(self.encoding))
finally:
termios.tcsetattr(stdin, termios.TCSADRAIN, oldtty)

Expand Down

0 comments on commit 0487a4a

Please sign in to comment.