fixed issue 1736, Unable to create/re-create cache file error for cache.disk, thanks arglanir

This commit is contained in:
Massimo committed 2013-10-31 09:40:39 -05:00
1 parent 1474a4fe79
commit 5b3b5b6821
2 files changed
+4 -3

No files matched your search

+1 -1
View File
@@ -1 +1 @@
Version 2.7.4-stable+timestamp.2013.10.30.08.58.58 Version 2.7.4-stable+timestamp.2013.10.31.09.39.21
+3 -2
View File
@@ -279,8 +279,9 @@ class CacheOnDisk(CacheAbstract):
logger.error('corrupted cache file %s, will try rebuild it' logger.error('corrupted cache file %s, will try rebuild it'
% self.shelve_name) % self.shelve_name)
storage = None storage = None
if not storage and os.path.exists(self.shelve_name): if storage is None:
os.unlink(self.shelve_name) if os.path.exists(self.shelve_name):
os.unlink(self.shelve_name)
storage = shelve.open(self.shelve_name) storage = shelve.open(self.shelve_name)
if not CacheAbstract.cache_stats_name in storage.keys(): if not CacheAbstract.cache_stats_name in storage.keys():
storage[CacheAbstract.cache_stats_name] = { storage[CacheAbstract.cache_stats_name] = {