Handle ValueError when unpickling, since this can be triggered by an
authorZac Medico <zmedico@gentoo.org>
Wed, 11 Mar 2009 05:56:01 +0000 (05:56 -0000)
committerZac Medico <zmedico@gentoo.org>
Wed, 11 Mar 2009 05:56:01 +0000 (05:56 -0000)
unsupported pickle protocol. (trunk r12648)

svn path=/main/branches/2.1.6/; revision=12919

pym/_emerge/__init__.py
pym/portage/__init__.py
pym/portage/dbapi/vartree.py
pym/portage/getbinpkg.py

index 977fae2571a4aece39176b0cc4d2c81189cd4864..1e9553fc35c613234e523f3f66b32477976f24cd 100644 (file)
@@ -4032,7 +4032,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)
index 88db818e93156094af3e3d3a46b596bd5c75ef8b..64b1b9792ad9cd843aafd633635bbd23bbdcc7a9 100644 (file)
@@ -7596,7 +7596,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)
index 90785459a7ebea55088153d1b7c871b1e815e880..6dceb8144457425be2d47bfb1a04f9faaf339627 100644 (file)
@@ -395,7 +395,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)
index 89252d4b892a46f1771ad21d9c7f8b2e8ba02ccd..f657c67a1a11fc9b74bbf6862afbfca0f66a4abe 100644 (file)
@@ -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]={}