From 7bf24395a8e8cc0e24e2ecf126bfd80b04a0f963 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 16 Jun 2016 21:05:07 +0530 Subject: [PATCH] ... --- 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 d9eab08140..a86d9874aa 100644 --- a/src/calibre/utils/terminal.py +++ b/src/calibre/utils/terminal.py @@ -141,10 +141,10 @@ class Detect(object): if self.is_console: from ctypes import wintypes, byref, c_wchar_p written = wintypes.DWORD(0) + text = text.replace('\0', '') chunk = len(text) while text: t, text = text[:chunk], text[chunk:] - t = t.partition('\0')[0] wt = c_wchar_p(t) if not self.write_console(self.file_handle, wt, len(t), byref(written), None): # Older versions of windows can fail to write large strings