Work on a project that requires me to sort a container object at any time, since we expect it to fail on external conditions quite often and be able to consciously choose where we left off.
I pretty often use the python protocol library, and all my classes start with a registrar setup:
class foo: def __init__(self): self.logger = logging.getLogger("package.foo")
Because I am building a container class, it has several layers of classes, each with its own log instance.
Now, for some reason, these recorders are breaking Pickle. I get the following error, which disappears if I remove self.logger from all classes:
Can't pickle 'lock' object: <thread.lock object at ... >
So my question is, is there a way to remove lock objects from all registrars without having to recurse through my entire object tree, deleting the registrars that I have to recreate on unickle.
python logging pickle
Josh areberg
source share