From aa43816d090b393e7e11d41670b7a288bef60c4a Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Sun, 19 May 2019 21:53:14 -0400 Subject: [PATCH] py3: make txtz input work --- src/calibre/ebooks/conversion/plugins/txt_input.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/calibre/ebooks/conversion/plugins/txt_input.py b/src/calibre/ebooks/conversion/plugins/txt_input.py index f5def565d2..e9f6fa54fe 100644 --- a/src/calibre/ebooks/conversion/plugins/txt_input.py +++ b/src/calibre/ebooks/conversion/plugins/txt_input.py @@ -138,7 +138,7 @@ class TXTInput(InputFormatPlugin): block_to_single_line, separate_hard_scene_breaks) self.log = log - txt = '' + txt = b'' log.debug('Reading text from file...') length = 0 base_dir = getcwd() @@ -151,7 +151,7 @@ class TXTInput(InputFormatPlugin): for x in walk('.'): if os.path.splitext(x)[1].lower() in ('.txt', '.text'): with open(x, 'rb') as tf: - txt += tf.read() + '\n\n' + txt += tf.read() + b'\n\n' else: if getattr(stream, 'name', None): base_dir = os.path.dirname(stream.name)