From 5b3dfa2595f8b7b5afdfeabbccbc1f76b6d34073 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 30 Nov 2012 23:17:13 +0530 Subject: [PATCH] Fix command line output on linux systems with incorrect LANG/LC_TYPE env vars. See #1085103 --- src/calibre/utils/terminal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/utils/terminal.py b/src/calibre/utils/terminal.py index b20c05f8ac..0736ba87d8 100644 --- a/src/calibre/utils/terminal.py +++ b/src/calibre/utils/terminal.py @@ -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'')):