Add Python 3 compatibility for rbssh.
Review Request #10475 — Created March 28, 2019 and submitted
Python 3 changed
sys.stdout
andsys.stderr
to require Unicode
strings, but this doesn't work so well for binary data, which rbssh
writes. Instead, we need to use thebuffer
attribute of both of these.This change updates rbssh to determine the right object to write to for
Python 2 and 3. It also disables warning output, which interferes with
the communication (and is triggered quite a lot by paramiko's
interaction with cryptography).
rbssh-based unit tests pass on Python 2 and 3 (when used with other
pending changes).