From a8d9f7aaa0bac02c2f4f1548658ab577936057e4 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 2 Jan 2011 13:37:22 -0700 Subject: [PATCH] Fix database integrity check breaking after a catalog generation. Fix thumbs.zip in use error when generating catalog on some windows machines. Apparently, os.remove is broken on windows --- src/calibre/library/catalog.py | 1 - src/calibre/library/database2.py | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/calibre/library/catalog.py b/src/calibre/library/catalog.py index f21f4278a4..6b34b7f08c 100644 --- a/src/calibre/library/catalog.py +++ b/src/calibre/library/catalog.py @@ -1005,7 +1005,6 @@ class EPUB_MOBI(CatalogPlugin): self.opts.log.warning(" invalidating cache at '%s'" % self.__archive_path) self.opts.log.warning(' thumb_width changed: %1.2f" => %1.2f"' % (float(cached_thumb_width),float(self.opts.thumb_width))) - os.remove(self.__archive_path) with ZipFile(self.__archive_path, mode='w') as zfw: zfw.writestr("Catalog Thumbs Archive",'') else: diff --git a/src/calibre/library/database2.py b/src/calibre/library/database2.py index 521f688251..611aa1cc89 100644 --- a/src/calibre/library/database2.py +++ b/src/calibre/library/database2.py @@ -102,7 +102,7 @@ class LibraryDatabase2(LibraryDatabase, SchemaUpgrade, CustomColumns): if self.user_version == 0: self.initialize_database() # remember to add any filter to the connect method in sqlite.py as well - # so that various code taht connects directly will not complain about + # so that various code that connects directly will not complain about # missing functions self.books_list_filter = self.conn.create_dynamic_filter('books_list_filter') # Store temporary tables in memory @@ -2778,7 +2778,6 @@ books_series_link feeds os.remove(dest) raise else: - os.remove(self.dbpath) shutil.copyfile(dest, self.dbpath) self.connect() self.initialize_dynamic()