[node-patches] Change in ovirt-node[master]: Set UTF-8 encoding on process.pipe as well for Py 2.6 compat
rbarry at redhat.com
rbarry at redhat.com
Fri Sep 27 18:35:00 UTC 2013
Ryan Barry has uploaded a new change for review.
Change subject: Set UTF-8 encoding on process.pipe as well for Py 2.6 compat
......................................................................
Set UTF-8 encoding on process.pipe as well for Py 2.6 compat
Previously, we only explicitly returned unicode-encoded output for
process.check_output. Do the same for process.pipe so lsblk on
the diagnostic page doesn't crash when it sees UTF-8 characters.
Change-Id: I0801bcd989da89749272d1e0f16dd4d17129c97e
Signed-off-by: Ryan Barry <rbarry at redhat.com>
---
M src/ovirt/node/utils/process.py
1 file changed, 2 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/26/19626/1
diff --git a/src/ovirt/node/utils/process.py b/src/ovirt/node/utils/process.py
index 70e1954..f103b0a 100644
--- a/src/ovirt/node/utils/process.py
+++ b/src/ovirt/node/utils/process.py
@@ -109,4 +109,5 @@
"stdout": PIPE,
"stderr": STDOUT})
__check_for_problems(cmd, kwargs)
- return unicode(popen(cmd, **kwargs).communicate(stdin)[0])
+ return unicode(popen(cmd, **kwargs).communicate(stdin)[0],
+ encoding=sys.stdin.encoding or "utf-8")
--
To view, visit http://gerrit.ovirt.org/19626
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I0801bcd989da89749272d1e0f16dd4d17129c97e
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Ryan Barry <rbarry at redhat.com>
More information about the node-patches
mailing list