From 515e59720f25bc0335f4e718826dbbb1a5fd8d1c Mon Sep 17 00:00:00 2001 From: Paul Varner Date: Wed, 20 May 2009 21:35:12 +0000 Subject: 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 --- bin/glsa-check | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'bin') 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") -- cgit v1.2.3-1-g7c22