mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
TXT Input: Dont fail if the txt file references a directory as a resosource. Fixes #1936184 [Txt conversion => azw3 failed](https://bugs.launchpad.net/calibre/+bug/1936184)
This commit is contained in:
parent
4d61c08281
commit
9efcc37f16
@ -116,7 +116,7 @@ class TXTInput(InputFormatPlugin):
|
||||
prefix = src.split(':', 1)[0].lower()
|
||||
if prefix not in ('file', 'http', 'https', 'ftp') and not os.path.isabs(src):
|
||||
src = os.path.join(base_dir, src)
|
||||
if os.access(src, os.R_OK):
|
||||
if os.path.isfile(src) and os.access(src, os.R_OK):
|
||||
with open(src, 'rb') as f:
|
||||
data = f.read()
|
||||
f = self.shift_file(os.path.basename(src), data)
|
||||
|
Loading…
x
Reference in New Issue
Block a user