1 |
Author: zmedico |
2 |
Date: 2008-05-26 23:05:46 +0000 (Mon, 26 May 2008) |
3 |
New Revision: 10432 |
4 |
|
5 |
Modified: |
6 |
main/branches/2.1.2/bin/emerge |
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. (trunk r10431) |
11 |
|
12 |
|
13 |
Modified: main/branches/2.1.2/bin/emerge |
14 |
=================================================================== |
15 |
--- main/branches/2.1.2/bin/emerge 2008-05-26 23:03:35 UTC (rev 10431) |
16 |
+++ main/branches/2.1.2/bin/emerge 2008-05-26 23:05:46 UTC (rev 10432) |
17 |
@@ -1586,7 +1586,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 |
@@ -1653,7 +1653,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 |
@@ -8408,7 +8408,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 |