diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-03-11 05:56:01 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-03-11 05:56:01 +0000 |
commit | 3a24bff78a5561b8f3a5fcb71d58244c693f13e1 (patch) | |
tree | ceb377d1aa886cc9e64c04011a5ebb8765f7fd14 | |
parent | 2c47365aa4b8ebd4271a415b48842027704e4cdc (diff) | |
download | portage-3a24bff78a5561b8f3a5fcb71d58244c693f13e1.tar.gz portage-3a24bff78a5561b8f3a5fcb71d58244c693f13e1.tar.bz2 portage-3a24bff78a5561b8f3a5fcb71d58244c693f13e1.zip |
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
-rw-r--r-- | pym/_emerge/__init__.py | 2 | ||||
-rw-r--r-- | pym/portage/__init__.py | 2 | ||||
-rw-r--r-- | pym/portage/dbapi/vartree.py | 2 | ||||
-rw-r--r-- | pym/portage/getbinpkg.py | 2 |
4 files changed, 4 insertions, 4 deletions
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]={} |