summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorPaul Varner <fuzzyray@gentoo.org>2009-05-20 21:35:12 +0000
committerZac Medico <zmedico@gentoo.org>2013-01-18 17:44:05 -0800
commit515e59720f25bc0335f4e718826dbbb1a5fd8d1c (patch)
tree25f63ac1f5c3a77bfca3341d98778515a6201d1d /bin
parente9a04922c144b267534e3335d2ff3d7bb8994b80 (diff)
downloadportage-515e59720f25bc0335f4e718826dbbb1a5fd8d1c.tar.gz
portage-515e59720f25bc0335f4e718826dbbb1a5fd8d1c.tar.bz2
portage-515e59720f25bc0335f4e718826dbbb1a5fd8d1c.zip
Handle unicode encoding when dumping to stdout and start migration to using StringIO
svn path=/trunk/gentoolkit/; revision=645 http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=88c18ffe936e602c45dcaa7500961623c49697ca
Diffstat (limited to 'bin')
-rwxr-xr-xbin/glsa-check5
1 files changed, 4 insertions, 1 deletions
diff --git a/bin/glsa-check b/bin/glsa-check
index ed0df3586..0e2b7a3d4 100755
--- a/bin/glsa-check
+++ b/bin/glsa-check
@@ -5,6 +5,7 @@
from __future__ import print_function
import sys
+import codecs
from os import path as osp
pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")
@@ -140,7 +141,9 @@ for p in params[:]:
glsalist.extend([g for g in params if g not in glsalist])
-def summarylist(myglsalist, fd1=sys.stdout, fd2=sys.stderr):
+def summarylist(myglsalist, fd1=sys.stdout, fd2=sys.stderr, encoding="utf-8"):
+ fd1 = codecs.getwriter(encoding)(fd1)
+ fd2 = codecs.getwriter(encoding)(fd2)
fd2.write(white("[A]")+" means this GLSA was already applied,\n")
fd2.write(green("[U]")+" means the system is not affected and\n")
fd2.write(red("[N]")+" indicates that the system might be affected.\n\n")