From 3b1a1fd6e60c5c07bfda40fad7056f43151c4654 Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Mon, 31 Oct 2011 23:00:49 +0100 Subject: [PATCH] [entropy.transceivers] EntropySshUriHandler: provide stdout, stderr in unicode format --- .../uri_handlers/plugins/interfaces/ssh_plugin.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/entropy/transceivers/uri_handlers/plugins/interfaces/ssh_plugin.py b/lib/entropy/transceivers/uri_handlers/plugins/interfaces/ssh_plugin.py index bbd85500e..bf7662550 100644 --- a/lib/entropy/transceivers/uri_handlers/plugins/interfaces/ssh_plugin.py +++ b/lib/entropy/transceivers/uri_handlers/plugins/interfaces/ssh_plugin.py @@ -14,6 +14,7 @@ import errno import time import tempfile import shutil +import codecs from entropy.const import const_isnumber, const_debug_write from entropy.output import brown, darkgreen, teal @@ -191,9 +192,10 @@ class EntropySshUriHandler(EntropyUriHandler): proc = self._subprocess.Popen(args, stdout = std_f, stderr = std_f_err) exec_rc = proc.wait() - with open(tmp_path, "rb") as std_f: + enc = etpConst['conf_encoding'] + with codecs.open(tmp_path, "r", encoding=enc) as std_f: output = std_f.read() - with open(tmp_path_err, "rb") as std_f: + with codecs.open(tmp_path_err, "r", encoding=enc) as std_f: error = std_f.read() finally: os.remove(tmp_path)