summaryrefslogtreecommitdiff
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-05-26 23:29:25 +0000
committerZac Medico <zmedico@gentoo.org>2008-05-26 23:29:25 +0000
commit45ff8239f28ef4ba3dd47b016147eccceeaa26e0 (patch)
tree0344d54e55ece7d23ad307ea7d40fa877d60c20d /pym
parentAvoid triggering "cPickle.UnpicklingError: Global and instance pickles (diff)
downloadportage-45ff8239f28ef4ba3dd47b016147eccceeaa26e0.tar.gz
portage-45ff8239f28ef4ba3dd47b016147eccceeaa26e0.tar.bz2
portage-45ff8239f28ef4ba3dd47b016147eccceeaa26e0.zip
Don't silently swallow instances of UnpicklingError since they are easily
triggered by storing instances of custom classes in a pickle. (trunk r10432:10434) svn path=/main/branches/2.1.2/; revision=10435
Diffstat (limited to 'pym')
-rw-r--r--pym/portage.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/pym/portage.py b/pym/portage.py
index 414fffd7c..b126fac3e 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -6923,8 +6923,11 @@ class vardbapi(dbapi):
self._aux_cache = mypickle.load()
f.close()
del f
- except (IOError, OSError, EOFError, cPickle.UnpicklingError):
- pass
+ except (IOError, OSError, EOFError, cPickle.UnpicklingError), e:
+ if isinstance(e, cPickle.UnpicklingError):
+ writemsg("!!! Error loading '%s': %s\n" % \
+ (self._aux_cache_filename, str(e)), noiselevel=-1)
+ del e
if not self._aux_cache or \
not isinstance(self._aux_cache, dict) or \
self._aux_cache.get("version") != self._aux_cache_version or \
@@ -10489,7 +10492,11 @@ class MtimeDB(dict):
d = mypickle.load()
f.close()
del f
- except (IOError, OSError, EOFError, cPickle.UnpicklingError):
+ except (IOError, OSError, EOFError, cPickle.UnpicklingError), e:
+ if isinstance(e, cPickle.UnpicklingError):
+ writemsg("!!! Error loading '%s': %s\n" % \
+ (filename, str(e)), noiselevel=-1)
+ del e
d = {}
if "old" in d: