1
0
mirror of https://github.com/ciromattia/kcc synced 2025-12-13 09:46:25 +00:00

Yet another Windows file lock fixes

This commit is contained in:
Paweł Jastrzębski
2015-09-12 09:48:17 +02:00
parent 2128104db7
commit 7b3bf4618f
2 changed files with 5 additions and 4 deletions

View File

@@ -678,7 +678,8 @@ def getWorkFolder(afile):
rmtree(workdir, True)
raise UserWarning("Failed to detect archive format.")
newpath = mkdtemp('', 'KCC-')
move(path, os.path.join(newpath, 'OEBPS', 'Images'))
copytree(path, os.path.join(newpath, 'OEBPS', 'Images'))
rmtree(src, True)
return newpath

View File

@@ -75,12 +75,12 @@ class MetadataParser:
extracted = True
if not extracted:
rmtree(workdir)
raise OSError
raise OSError('Failed to extract 7ZIP file.')
if os.path.isfile(tmpXML):
self.rawdata = parse(tmpXML)
rmtree(workdir)
else:
raise OSError
raise OSError('Failed to detect archive format.')
if self.rawdata:
self.parseXML()
@@ -168,5 +168,5 @@ class MetadataParser:
extracted = True
if not extracted:
rmtree(workdir)
raise OSError
raise OSError('Failed to modify 7ZIP file.')
rmtree(workdir)