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

fabiand at fedoraproject.org fabiand at fedoraproject.org
Tue May 21 12:19:47 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: Iaa6336da7cc8c53ce894267685f5f5949c2a0145
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/27/14927/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/14927
To unsubscribe, visit http://gerrit.ovirt.org/settings

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



More information about the node-patches mailing list