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

This commit is contained in:
Massimo
2013-10-31 09:40:39 -05:00
parent 1474a4fe79
commit 5b3b5b6821
2 changed files with 4 additions and 3 deletions

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

View File

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