diff --git a/dosage b/dosage index b6e616306..6743a7ece 100755 --- a/dosage +++ b/dosage @@ -288,10 +288,8 @@ def doList(columnList=True, verbose=False): """List available comics.""" page = hasattr(sys.stdout, "isatty") and sys.stdout.isatty() if page: - fd = StringIO() - else: - fd = sys.stdout - out.setStream(fd) + fd = StringIO(u'') + out.setStream(fd) out.info(u'Available comic scrapers:') out.info(u'Comics tagged with [%s] require age confirmation with the --adult option.' % TAG_ADULT) out.info(u'Non-english comics are tagged with [%s].' % TAG_LANG) diff --git a/dosagelib/ansicolor.py b/dosagelib/ansicolor.py index 4d43bced2..4fc634a10 100644 --- a/dosagelib/ansicolor.py +++ b/dosagelib/ansicolor.py @@ -1,5 +1,5 @@ # -*- coding: iso-8859-1 -*- -# Copyright (C) 2000-2012 Bastian Kleineidam +# Copyright (C) 2000-2013 Bastian Kleineidam """ ANSI Color definitions and functions. For Windows systems, the colorama module uses ctypes and Windows DLLs to generate colored output. diff --git a/dosagelib/output.py b/dosagelib/output.py index 43ff996f2..2a67d419a 100644 --- a/dosagelib/output.py +++ b/dosagelib/output.py @@ -26,11 +26,11 @@ class Output(object): self.encoding = 'utf-8' else: self.encoding = encoding + stream = codecs.getwriter(self.encoding)(stream) self.setStream(stream) def setStream(self, stream): """Initialize context and indentation.""" - stream = codecs.getwriter(self.encoding)(stream) self.stream = Colorizer(stream) def info(self, s, level=0):