mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
Fix #924 (CBZ Convert Error)
This commit is contained in:
parent
6eb005d5c6
commit
9b7500375b
@ -1028,11 +1028,13 @@ class ZipFile:
|
||||
|
||||
# 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…
x
Reference in New Issue
Block a user