Handle ValueError when unpickling, since this can be triggered by an
authorZac Medico <zmedico@gentoo.org>
Thu, 19 Feb 2009 12:36:51 +0000 (12:36 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 19 Feb 2009 12:36:51 +0000 (12:36 -0000)
unsupported pickle protocol.

svn path=/main/trunk/; revision=12648

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

index 073bc03acebda15ac4c33874a32dee70964d5415..e8d63492914e7fcda82b9ab40139894ca6c04f04 100644 (file)
@@ -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)
index b025142f91abbb4981ee1b375a2295af83141eca..96856612966b639a7e1eb2cc5943f5cd5072a7eb 100644 (file)
@@ -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)
index f2d0d1a77865d08754019c1b286f7824413be76c..0685382a5079cd31ee0bf842a823d78d62e7d4ec 100644 (file)
@@ -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)
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]={}