summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-02-19 12:36:51 +0000
committerZac Medico <zmedico@gentoo.org>2009-02-19 12:36:51 +0000
commit1b83c9cc1d75a28320dd72e3f1875c481d971f7e (patch)
tree28e24775d952fca70bb394ea92e6ec4ed829f369
parent8be1a1f81066241318ee5be858285ff14500884f (diff)
downloadportage-1b83c9cc1d75a28320dd72e3f1875c481d971f7e.tar.gz
portage-1b83c9cc1d75a28320dd72e3f1875c481d971f7e.tar.bz2
portage-1b83c9cc1d75a28320dd72e3f1875c481d971f7e.zip
Handle ValueError when unpickling, since this can be triggered by an
unsupported pickle protocol. svn path=/main/trunk/; revision=12648
-rw-r--r--pym/_emerge/__init__.py2
-rw-r--r--pym/portage/__init__.py2
-rw-r--r--pym/portage/dbapi/vartree.py2
-rw-r--r--pym/portage/getbinpkg.py2
4 files changed, 4 insertions, 4 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py
index 073bc03ac..e8d634929 100644
--- a/pym/_emerge/__init__.py
+++ b/pym/_emerge/__init__.py
@@ -4048,7 +4048,7 @@ class BlockerCache(portage.cache.mappings.MutableMapping):
self._cache_data = mypickle.load()
f.close()
del f
- except (IOError, OSError, EOFError, pickle.UnpicklingError), e:
+ except (IOError, OSError, EOFError, ValueError, pickle.UnpicklingError), e:
if isinstance(e, pickle.UnpicklingError):
writemsg("!!! Error loading '%s': %s\n" % \
(self._cache_filename, str(e)), noiselevel=-1)
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index b025142f9..968566129 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -7609,7 +7609,7 @@ class MtimeDB(dict):
d = mypickle.load()
f.close()
del f
- except (IOError, OSError, EOFError, pickle.UnpicklingError), e:
+ except (IOError, OSError, EOFError, ValueError, pickle.UnpicklingError), e:
if isinstance(e, pickle.UnpicklingError):
writemsg("!!! Error loading '%s': %s\n" % \
(filename, str(e)), noiselevel=-1)
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
index f2d0d1a77..0685382a5 100644
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
@@ -1050,7 +1050,7 @@ class vardbapi(dbapi):
aux_cache = mypickle.load()
f.close()
del f
- except (IOError, OSError, EOFError, pickle.UnpicklingError), e:
+ except (IOError, OSError, EOFError, ValueError, pickle.UnpicklingError), e:
if isinstance(e, pickle.UnpicklingError):
writemsg("!!! Error loading '%s': %s\n" % \
(self._aux_cache_filename, str(e)), noiselevel=-1)
diff --git a/pym/portage/getbinpkg.py b/pym/portage/getbinpkg.py
index 89252d4b8..f657c67a1 100644
--- a/pym/portage/getbinpkg.py
+++ b/pym/portage/getbinpkg.py
@@ -491,7 +491,7 @@ def dir_get_metadata(baseurl, conn=None, chunk_size=3000, verbose=1, usingcache=
out.write("Loaded metadata pickle.\n")
out.flush()
metadatafile.close()
- except (pickle.UnpicklingError, OSError, IOError, EOFError):
+ except (IOError, OSError, EOFError, ValueError, pickle.UnpicklingError):
metadata = {}
if baseurl not in metadata:
metadata[baseurl]={}