summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rdiff-backup/CHANGELOG7
-rw-r--r--rdiff-backup/rdiff_backup/rorpiter.py8
2 files changed, 13 insertions, 2 deletions
diff --git a/rdiff-backup/CHANGELOG b/rdiff-backup/CHANGELOG
index feed2a3..fdfebc6 100644
--- a/rdiff-backup/CHANGELOG
+++ b/rdiff-backup/CHANGELOG
@@ -1,3 +1,10 @@
+New in v1.2.1 (????/??/??)
+---------------------------
+
+Don't crash if a CacheIndexable tries to clear a non-existent cache entry,
+since the entry must already be cleared. (Andrew Ferguson)
+
+
New in v1.2.0 (2008/07/27)
---------------------------
diff --git a/rdiff-backup/rdiff_backup/rorpiter.py b/rdiff-backup/rdiff_backup/rorpiter.py
index aec3f32..8fa9446 100644
--- a/rdiff-backup/rdiff_backup/rorpiter.py
+++ b/rdiff-backup/rdiff_backup/rorpiter.py
@@ -344,8 +344,12 @@ class CacheIndexable:
self.cache_dict[next_index] = next_elem
self.cache_indicies.append(next_index)
- if len(self.cache_indicies) > self.cache_size:
- del self.cache_dict[self.cache_indicies[0]]
+ if len(self.cache_indicies) > self.cache_size:
+ try:
+ del self.cache_dict[self.cache_indicies[0]]
+ except KeyError:
+ log.Log("Warning: index %s missing from iterator cache" %
+ (first_index,),2)
del self.cache_indicies[0]
return next_elem