public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Zac Medico" <zmedico@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/dbapi/, pym/portage/, pym/_emerge/
Date: Sat, 29 Sep 2012 02:36:32 +0000 (UTC)	[thread overview]
Message-ID: <1348886177.2377357f4e0164d338c1249c79f479229aa7c0e4.zmedico@gentoo> (raw)

commit:     2377357f4e0164d338c1249c79f479229aa7c0e4
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Sep 29 02:36:17 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Sep 29 02:36:17 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=2377357f

Handle KeyError when loading pickles.

See http://forums.gentoo.org/viewtopic-t-938022.html for example.

---
 pym/_emerge/BlockerCache.py  |    4 +++-
 pym/portage/dbapi/vartree.py |    4 +++-
 pym/portage/getbinpkg.py     |    4 +++-
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/pym/_emerge/BlockerCache.py b/pym/_emerge/BlockerCache.py
index fce81f8..9195524 100644
--- a/pym/_emerge/BlockerCache.py
+++ b/pym/_emerge/BlockerCache.py
@@ -62,7 +62,9 @@ class BlockerCache(portage.cache.mappings.MutableMapping):
 			self._cache_data = mypickle.load()
 			f.close()
 			del f
-		except (AttributeError, EOFError, EnvironmentError, ValueError, pickle.UnpicklingError) as e:
+		except (SystemExit, KeyboardInterrupt):
+			raise
+		except Exception as e:
 			if isinstance(e, EnvironmentError) and \
 				getattr(e, 'errno', None) in (errno.ENOENT, errno.EACCES):
 				pass

diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
index f8980f7..5299b29 100644
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
@@ -585,7 +585,9 @@ class vardbapi(dbapi):
 			aux_cache = mypickle.load()
 			f.close()
 			del f
-		except (AttributeError, EOFError, EnvironmentError, ValueError, pickle.UnpicklingError) as e:
+		except (SystemExit, KeyboardInterrupt):
+			raise
+		except Exception as e:
 			if isinstance(e, EnvironmentError) and \
 				getattr(e, 'errno', None) in (errno.ENOENT, errno.EACCES):
 				pass

diff --git a/pym/portage/getbinpkg.py b/pym/portage/getbinpkg.py
index 34a5e0e..538f8c2 100644
--- a/pym/portage/getbinpkg.py
+++ b/pym/portage/getbinpkg.py
@@ -559,7 +559,9 @@ def dir_get_metadata(baseurl, conn=None, chunk_size=3000, verbose=1, usingcache=
 		out.write(_("Loaded metadata pickle.\n"))
 		out.flush()
 		metadatafile.close()
-	except (AttributeError, EOFError, EnvironmentError, ValueError, pickle.UnpicklingError):
+	except (SystemExit, KeyboardInterrupt):
+		raise
+	except Exception:
 		metadata = {}
 	if baseurl not in metadata:
 		metadata[baseurl]={}


             reply	other threads:[~2012-09-29  2:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-29  2:36 Zac Medico [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-03-27 18:28 [gentoo-commits] proj/portage:master commit in: pym/portage/dbapi/, pym/portage/, pym/_emerge/ Zac Medico
2012-02-14 12:30 Zac Medico
2011-10-24 17:55 Zac Medico
2011-08-26 19:55 Zac Medico

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1348886177.2377357f4e0164d338c1249c79f479229aa7c0e4.zmedico@gentoo \
    --to=zmedico@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox