From 88c18ffe936e602c45dcaa7500961623c49697ca Mon Sep 17 00:00:00 2001 From: fuzzyray 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 --- 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 f33bc23..9b99451 100644 --- a/bin/glsa-check +++ b/bin/glsa-check @@ -5,6 +5,7 @@ import os import sys +import codecs try: import portage except ImportError: @@ -199,7 +200,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) if not quiet: fd2.write(white("[A]")+" means this GLSA was already applied,\n") fd2.write(green("[U]")+" means the system is not affected and\n") -- cgit v1.2.3