From: Zac Medico Date: Wed, 11 Mar 2009 05:56:01 +0000 (-0000) Subject: Handle ValueError when unpickling, since this can be triggered by an X-Git-Tag: v2.1.6.8~158 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=3a24bff78a5561b8f3a5fcb71d58244c693f13e1;p=portage.git Handle ValueError when unpickling, since this can be triggered by an unsupported pickle protocol. (trunk r12648) svn path=/main/branches/2.1.6/; revision=12919 --- diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index 977fae257..1e9553fc3 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -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) diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index 88db818e9..64b1b9792 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -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) diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index 90785459a..6dceb8144 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -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) 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]={}