class X: def __init__(self, s): self.s = s I used only this simple class for testing. I forgot to copy it in the example. My debugging ends at the call to marshal.dumps()/loads() in the (Un-)Pickler class.