Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r10435 - in main/branches/2.1.2: bin pym
Date: Mon, 26 May 2008 23:29:29
Message-Id: E1K0m86-0007qL-JP@stork.gentoo.org
1 Author: zmedico
2 Date: 2008-05-26 23:29:25 +0000 (Mon, 26 May 2008)
3 New Revision: 10435
4
5 Modified:
6 main/branches/2.1.2/bin/emerge
7 main/branches/2.1.2/pym/portage.py
8 Log:
9 Don't silently swallow instances of UnpicklingError since they are easily
10 triggered by storing instances of custom classes in a pickle.
11 (trunk r10432:10434)
12
13
14 Modified: main/branches/2.1.2/bin/emerge
15 ===================================================================
16 --- main/branches/2.1.2/bin/emerge 2008-05-26 23:22:15 UTC (rev 10434)
17 +++ main/branches/2.1.2/bin/emerge 2008-05-26 23:29:25 UTC (rev 10435)
18 @@ -1557,8 +1557,11 @@
19 self._cache_data = mypickle.load()
20 f.close()
21 del f
22 - except (IOError, OSError, EOFError, cPickle.UnpicklingError):
23 - pass
24 + except (IOError, OSError, EOFError, cPickle.UnpicklingError), e:
25 + if isinstance(e, cPickle.UnpicklingError):
26 + writemsg("!!! Error loading '%s': %s\n" % \
27 + (self._cache_filename, str(e)), noiselevel=-1)
28 + del e
29 cache_valid = self._cache_data and \
30 isinstance(self._cache_data, dict) and \
31 self._cache_data.get("version") == self._cache_version and \
32
33 Modified: main/branches/2.1.2/pym/portage.py
34 ===================================================================
35 --- main/branches/2.1.2/pym/portage.py 2008-05-26 23:22:15 UTC (rev 10434)
36 +++ main/branches/2.1.2/pym/portage.py 2008-05-26 23:29:25 UTC (rev 10435)
37 @@ -6923,8 +6923,11 @@
38 self._aux_cache = mypickle.load()
39 f.close()
40 del f
41 - except (IOError, OSError, EOFError, cPickle.UnpicklingError):
42 - pass
43 + except (IOError, OSError, EOFError, cPickle.UnpicklingError), e:
44 + if isinstance(e, cPickle.UnpicklingError):
45 + writemsg("!!! Error loading '%s': %s\n" % \
46 + (self._aux_cache_filename, str(e)), noiselevel=-1)
47 + del e
48 if not self._aux_cache or \
49 not isinstance(self._aux_cache, dict) or \
50 self._aux_cache.get("version") != self._aux_cache_version or \
51 @@ -10489,7 +10492,11 @@
52 d = mypickle.load()
53 f.close()
54 del f
55 - except (IOError, OSError, EOFError, cPickle.UnpicklingError):
56 + except (IOError, OSError, EOFError, cPickle.UnpicklingError), e:
57 + if isinstance(e, cPickle.UnpicklingError):
58 + writemsg("!!! Error loading '%s': %s\n" % \
59 + (filename, str(e)), noiselevel=-1)
60 + del e
61 d = {}
62
63 if "old" in d:
64
65 --
66 gentoo-commits@l.g.o mailing list