[yum-git] output.py

Seth Vidal skvidal at linux.duke.edu
Thu Apr 10 17:55:14 UTC 2008


 output.py |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 7866b7cfcd8918d11351dbba051b9b7584e11e77
Author: Seth Vidal <skvidal at fedoraproject.org>
Date:   Thu Apr 10 13:54:13 2008 -0400

    make sure we catch random emissions from rpm :(

diff --git a/output.py b/output.py
index 8b975ee..697c456 100644
--- a/output.py
+++ b/output.py
@@ -29,7 +29,7 @@ import re # For YumTerm
 
 from urlgrabber.progress import TextMeter
 from urlgrabber.grabber import URLGrabError
-from yum.misc import sortPkgObj, prco_tuple_to_string, to_str
+from yum.misc import sortPkgObj, prco_tuple_to_string, to_str, to_unicode
 from rpmUtils.miscutils import checkSignals
 from yum.constants import *
 
@@ -755,7 +755,10 @@ class YumCliRPMCallBack(RPMBaseCallback):
 
     def scriptout(self, package, msgs):
         if msgs:
-            sys.stdout.write(msgs)
+            if not sys.stdout.isatty():
+                sys.stdout.write(to_unicode(msgs))
+            else:
+                sys.stdout.write(msgs)
             sys.stdout.flush()
 
     def _makefmt(self, percent, ts_current, ts_total, progress = True):



More information about the Yum-cvs-commits mailing list