From d7ed14e30c8a0cff05cac6d880a06a7cd2f5f8c0 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 11 Feb 2014 08:32:50 +0530 Subject: [PATCH] ... --- src/calibre/utils/terminal.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/calibre/utils/terminal.py b/src/calibre/utils/terminal.py index 75658148b2..19c67b1520 100644 --- a/src/calibre/utils/terminal.py +++ b/src/calibre/utils/terminal.py @@ -120,7 +120,7 @@ class Detect(object): except: pass - def write_unicode_text(self, text): + def write_unicode_text(self, text, ignore_errors=False): ' Windows only method that writes unicode strings correctly to the windows console using the Win32 API ' if self.is_console: from ctypes import wintypes, byref, c_wchar_p @@ -150,7 +150,8 @@ class Detect(object): from calibre.utils.filenames import ascii_text print (ascii_text(t + text), file=self.stream, end='') continue - raise ctypes.WinError(err) + if not ignore_errors: + raise ctypes.WinError(err) _crt = None def crt():