about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPaweł Jastrzębski <pawelj@iosphe.re>2015-09-12 09:48:17 +0200
committerPaweł Jastrzębski <pawelj@iosphe.re>2015-09-12 09:48:17 +0200
commit7b3bf4618fc37ec017abe2c49ed20804f2cdc9c4 (patch)
treec841b4628479476509d8218616b84d913c4cc1b5
parentUpdated README + version bump (diff)
downloadkcc-7b3bf4618fc37ec017abe2c49ed20804f2cdc9c4.tar.gz
kcc-7b3bf4618fc37ec017abe2c49ed20804f2cdc9c4.tar.bz2
kcc-7b3bf4618fc37ec017abe2c49ed20804f2cdc9c4.zip
Yet another Windows file lock fixes
-rwxr-xr-xkcc/comic2ebook.py3
-rw-r--r--kcc/metadata.py6
2 files changed, 5 insertions, 4 deletions
diff --git a/kcc/comic2ebook.py b/kcc/comic2ebook.py
index 0fc3db7..200c634 100755
--- a/kcc/comic2ebook.py
+++ b/kcc/comic2ebook.py
@@ -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
 
 
diff --git a/kcc/metadata.py b/kcc/metadata.py
index 1977099..da57e12 100644
--- a/kcc/metadata.py
+++ b/kcc/metadata.py
@@ -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)