Fix line endings in SSH commands in Windows
@@ -73,7 +73,9 @@ class SshCPythonBackend(BaseBackend, SshMixin):
super().send_message(msg)
def _forward_incoming_command(self, msg):
- self._proc.stdin.write(serialize_message(msg) + "\n")
+ # sending as bytes, otherwise Paramiko does something funny
+ # (expands "\n" to "\r\n" ?)
+ self._proc.stdin.write((serialize_message(msg) + "\n").encode("ascii"))
def _start_response_forwarder(self):
self._response_forwarder = Thread(target=self._forward_main_responses, daemon=True)
