diff options
author | Zac Medico <zmedico@gentoo.org> | 2008-05-26 23:05:46 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2008-05-26 23:05:46 +0000 |
commit | 7a5c2760101172f78ca6d8f7ce7fa93f55cc7466 (patch) | |
tree | 683f75b9eb9ff6e5c63074148d69e5b8817a7840 /bin | |
parent | a32949e6e6266b2ae00b93c5d61a5c17f6802609 (diff) | |
download | portage-7a5c2760101172f78ca6d8f7ce7fa93f55cc7466.tar.gz portage-7a5c2760101172f78ca6d8f7ce7fa93f55cc7466.tar.bz2 portage-7a5c2760101172f78ca6d8f7ce7fa93f55cc7466.zip |
Avoid triggering "cPickle.UnpicklingError: Global and instance pickles
are not supported." errors that are triggered when the pickle contains
custom classes. (trunk r10431)
svn path=/main/branches/2.1.2/; revision=10432
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/emerge | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/bin/emerge b/bin/emerge index b9ecd76fe..acb42e4f2 100755 --- a/bin/emerge +++ b/bin/emerge @@ -1586,7 +1586,7 @@ class BlockerCache(DictMixin): if not isinstance(counter, (int, long)): invalid_items.add(k) continue - if not isinstance(atoms, list): + if not isinstance(atoms, (list, tuple)): invalid_items.add(k) continue invalid_atom = False @@ -1653,7 +1653,7 @@ class BlockerCache(DictMixin): @type blocker_data: BlockerData """ self._cache_data["blockers"][cpv] = \ - (blocker_data.counter, blocker_data.atoms) + (blocker_data.counter, tuple(str(x) for x in blocker_data.atoms)) self._modified = True def __iter__(self): @@ -8408,7 +8408,17 @@ def action_build(settings, trees, mtimedb, # XXX: Stored as a list for backward compatibility. mtimedb["resume"]["myopts"] = \ [k for k in myopts if myopts[k] is True] - mtimedb["resume"]["favorites"]=favorites + + # Convert Atom instances to plain str since the mtimedb loader + # sets unpickler.find_global = None which causes unpickler.load() + # to raise the following exception: + # + # cPickle.UnpicklingError: Global and instance pickles are not supported. + # + # TODO: Maybe stop setting find_global = None, or find some other + # way to avoid accidental triggering of the above UnpicklingError. + mtimedb["resume"]["favorites"] = [str(x) for x in favorites] + if ("--digest" in myopts) and not ("--fetchonly" in myopts or "--fetch-all-uri" in myopts): for pkgline in mydepgraph.altlist(): if pkgline[0]=="ebuild" and pkgline[3]=="merge": |