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:
@@ -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
|
||||
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user