7c7493feb5
Add encoding and errors parameters to execute() and ssh_execute(). By default, use the locale encoding in strict mode on Python 2, or the locale encoding with the 'surrogateescape' error handler on Python 3. Fix also unit tests to use bytes strings for stdin, stdout and stderr. Without this change, tests are failing with Python 3 when run with: PYTHON="python -bb" testr run Using -bb, Python 3 raises a TypeError when a bytes string is casted to a text string, which occurred in many places. Change-Id: I655d5abf932c9a104e3ab487e23c372377f7096a