mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 10:44:09 -04:00
py3: make txtz input work
This commit is contained in:
parent
fda2ab0024
commit
aa43816d09
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user