mirror of
git://github.com/kovidgoyal/calibre.git
synced 2025-12-22 03:46:21 +01:00
Fix #924 (CBZ Convert Error)
This commit is contained in:
parent
6eb005d5c6
commit
9b7500375b
1 changed files with 4 additions and 2 deletions
|
|
@ -1028,11 +1028,13 @@ def _extract_member(self, member, targetpath, pwd):
|
|||
|
||||
# Create all upper directories if necessary.
|
||||
upperdirs = os.path.dirname(targetpath)
|
||||
if upperdirs and not os.path.isdir(upperdirs):
|
||||
os.unlink(upperdirs)
|
||||
if upperdirs and not os.path.exists(upperdirs):
|
||||
os.makedirs(upperdirs)
|
||||
|
||||
|
||||
source = self.open(member, pwd=pwd)
|
||||
target = file(targetpath, "wb")
|
||||
target = open(targetpath, "wb")
|
||||
shutil.copyfileobj(source, target)
|
||||
source.close()
|
||||
target.close()
|
||||
|
|
|
|||
Loading…
Reference in a new issue