Edit Book: Fix import HTML file as new book not working on OS X

This commit is contained in:
Kovid Goyal 2014-03-02 08:56:42 +05:30
parent a3fa1e9e49
commit 64d48f778c

View File

@ -34,6 +34,7 @@ def import_book_as_epub(srcpath, destpath, log=default_log):
if not destpath.lower().endswith('.epub'):
raise ValueError('Can only import books into the EPUB format, not %s' % (os.path.basename(destpath)))
with TemporaryDirectory('eei') as tdir:
tdir = os.path.abspath(os.path.realpath(tdir)) # Needed to handle the multiple levels of symlinks for /tmp on OS X
plumber = Plumber(srcpath, tdir, log)
plumber.setup_options()
if srcpath.lower().endswith('.opf'):