mirror of
git://github.com/kovidgoyal/calibre.git
synced 2025-12-29 02:46:10 +01: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
1 changed files with 1 additions and 1 deletions
|
|
@ -116,7 +116,7 @@ def fix_resources(self, html, base_dir):
|
|||
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…
Reference in a new issue