[node-patches] Change in ovirt-node[node-3.0]: process: Fix check_output

fabiand at fedoraproject.org fabiand at fedoraproject.org
Tue May 21 14:42:22 UTC 2013


Fabian Deutsch has uploaded a new change for review.

Change subject: process: Fix check_output
......................................................................

process: Fix check_output

Previously no hint was given to unicode() on how to decode the bytes
returned from check_output(), now the encoding of sys.stdin.encoding is
given as a hint.

Change-Id: I64b1e48360e5076bc94d701cda1defad46876979
Signed-off-by: Fabian Deutsch <fabiand at fedoraproject.org>
---
M src/ovirt/node/utils/process.py
1 file changed, 6 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/44/14944/1

diff --git a/src/ovirt/node/utils/process.py b/src/ovirt/node/utils/process.py
index 23aa843..f837a04 100644
--- a/src/ovirt/node/utils/process.py
+++ b/src/ovirt/node/utils/process.py
@@ -18,14 +18,15 @@
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 # MA  02110-1301, USA.  A copy of the GNU General Public License is
 # also available at http://www.gnu.org/copyleft/gpl.html.
+from subprocess import STDOUT, PIPE
+import logging
+import subprocess
+import sys
 
 """
 Some convenience functions related to processes
 """
 
-import subprocess
-import logging
-from subprocess import STDOUT, PIPE
 
 LOGGER = logging.getLogger(__name__)
 
@@ -66,7 +67,8 @@
     """
     kwargs.update(COMMON_POPEN_ARGS)
     LOGGER.debug("Checking output with: %s %s" % (args, kwargs))
-    return unicode(subprocess.check_output(*args, **kwargs))
+    return unicode(subprocess.check_output(*args, **kwargs),
+                   encoding=sys.stdin.encoding)
 
 
 def pipe(cmd, stdin=None):


--
To view, visit http://gerrit.ovirt.org/14944
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I64b1e48360e5076bc94d701cda1defad46876979
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: node-3.0
Gerrit-Owner: Fabian Deutsch <fabiand at fedoraproject.org>



More information about the node-patches mailing list