mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 18:54:09 -04:00
EPUB Input: Fix bug in unzipping EPUB files that have been zipped in depth first order. Fixes #6127 (Cannot open or convert News Feed "books" - problems with path in Windows)
This commit is contained in:
parent
ec607dc596
commit
c8438cc296
@ -213,7 +213,7 @@ class KINDLE_DX(KINDLE2):
|
||||
PRODUCT_ID = [0x0003]
|
||||
BCD = [0x0100]
|
||||
|
||||
class Bookmark():
|
||||
class Bookmark(): # {{{
|
||||
'''
|
||||
A simple class fetching bookmark data
|
||||
Kindle-specific
|
||||
@ -517,3 +517,6 @@ class Bookmark():
|
||||
|
||||
else:
|
||||
print "unsupported bookmark_extension: %s" % self.bookmark_extension
|
||||
|
||||
# }}}
|
||||
|
||||
|
@ -1071,8 +1071,13 @@ class ZipFile:
|
||||
|
||||
# Create all upper directories if necessary.
|
||||
upperdirs = os.path.dirname(targetpath)
|
||||
if upperdirs and os.path.exists(upperdirs) and not os.path.isdir(upperdirs):
|
||||
os.unlink(upperdirs)
|
||||
while upperdirs:
|
||||
if os.path.exists(upperdirs):
|
||||
if os.path.isdir(upperdirs):
|
||||
break
|
||||
os.remove(upperdirs)
|
||||
upperdirs = os.path.dirname(upperdirs)
|
||||
upperdirs = os.path.dirname(targetpath)
|
||||
if upperdirs and not os.path.exists(upperdirs):
|
||||
os.makedirs(upperdirs)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user