diff --git a/libraries/entropy/cache.py b/libraries/entropy/cache.py index 6a96fa404..ea3e3ac8a 100644 --- a/libraries/entropy/cache.py +++ b/libraries/entropy/cache.py @@ -15,7 +15,7 @@ entropy.client.interfaces.cache mixin methods) """ - +import sys from entropy.core import Singleton from entropy.misc import TimeScheduled, Lifo import time @@ -219,7 +219,14 @@ class EntropyCacher(Singleton): return if async: with self.__cache_lock: - self.__cache_buffer.push((key, self.__copy_obj(data),)) + try: + self.__cache_buffer.push((key, self.__copy_obj(data),)) + except TypeError: + # sometimes, very rarely, copy.deepcopy() is unable + # to properly copy an object (blame Python bug) + sys.stdout.write("!!! cannot cache object with key %s\n" % ( + key,)) + sys.stdout.flush() else: self.dumpTools.dumpobj(key, data)