Fix command line output on linux systems with incorrect LANG/LC_TYPE env vars. See #1085103

This commit is contained in:
Kovid Goyal 2012-11-30 23:17:13 +05:30
parent 629277a2f4
commit 5b3dfa2595

View File

@ -146,7 +146,7 @@ class ANSIStream(Detect):
def __init__(self, stream=None):
super(ANSIStream, self).__init__(stream)
self.encoding = getattr(self.stream, 'encoding', 'utf-8')
self.encoding = getattr(self.stream, 'encoding', 'utf-8') or 'utf-8'
def write(self, text):
if isinstance(text, type(u'')):