Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r10431 - main/trunk/pym/_emerge
Date: Mon, 26 May 2008 23:03:41
Message-Id: E1K0lj7-0003XL-5q@stork.gentoo.org
1 Author: zmedico
2 Date: 2008-05-26 23:03:35 +0000 (Mon, 26 May 2008)
3 New Revision: 10431
4
5 Modified:
6 main/trunk/pym/_emerge/__init__.py
7 Log:
8 Avoid triggering "cPickle.UnpicklingError: Global and instance pickles
9 are not supported." errors that are triggered when the pickle contains
10 custom classes.
11
12
13 Modified: main/trunk/pym/_emerge/__init__.py
14 ===================================================================
15 --- main/trunk/pym/_emerge/__init__.py 2008-05-26 20:24:02 UTC (rev 10430)
16 +++ main/trunk/pym/_emerge/__init__.py 2008-05-26 23:03:35 UTC (rev 10431)
17 @@ -1452,7 +1452,7 @@
18 if not isinstance(counter, (int, long)):
19 invalid_items.add(k)
20 continue
21 - if not isinstance(atoms, list):
22 + if not isinstance(atoms, (list, tuple)):
23 invalid_items.add(k)
24 continue
25 invalid_atom = False
26 @@ -1519,7 +1519,7 @@
27 @type blocker_data: BlockerData
28 """
29 self._cache_data["blockers"][cpv] = \
30 - (blocker_data.counter, blocker_data.atoms)
31 + (blocker_data.counter, tuple(str(x) for x in blocker_data.atoms))
32 self._modified = True
33
34 def __iter__(self):
35 @@ -8472,7 +8472,17 @@
36 # XXX: Stored as a list for backward compatibility.
37 mtimedb["resume"]["myopts"] = \
38 [k for k in myopts if myopts[k] is True]
39 - mtimedb["resume"]["favorites"]=favorites
40 +
41 + # Convert Atom instances to plain str since the mtimedb loader
42 + # sets unpickler.find_global = None which causes unpickler.load()
43 + # to raise the following exception:
44 + #
45 + # cPickle.UnpicklingError: Global and instance pickles are not supported.
46 + #
47 + # TODO: Maybe stop setting find_global = None, or find some other
48 + # way to avoid accidental triggering of the above UnpicklingError.
49 + mtimedb["resume"]["favorites"] = [str(x) for x in favorites]
50 +
51 if ("--digest" in myopts) and not ("--fetchonly" in myopts or "--fetch-all-uri" in myopts):
52 for pkgline in mydepgraph.altlist():
53 if pkgline[0]=="ebuild" and pkgline[3]=="merge":
54
55 --
56 gentoo-commits@l.g.o mailing list