How to stop attributes from being pickled in Python

Posted by Ries on Stack Overflow See other posts from Stack Overflow or by Ries
Published on 2010-06-08T17:19:42Z Indexed on 2010/06/08 17:22 UTC
Read the original article Hit count: 165

Filed under:
|

I am using gnosis.xml.pickle to convert an object of my own class to xml. The object is initialized so that:

self.logger = MyLogger()

But when I do dump the object to a string I get an exception stating that the pickler encountered an unpickleable type .

Is there a way to 'tag' the logger attribute so that pickler will know not to try and pickle that attribute?

© Stack Overflow or respective owner

Related posts about python

Related posts about pickle