On Nov 10, 2:23 pm, mark starnes <[EMAIL PROTECTED]> wrote: > Hi everyone, this is my first post to this group, so please be gentle. > > I've written a class which, when I attempt to pickle, gives the error: > > *** RuntimeError: maximum recursion depth exceeded > > Is there a way to make pickle display data about what it's trying > to do? I'm thinking that if so, the recursive component will be > immediately visible, easing the bug hunt. > > Any help would be appreciated.
How about commenting out one by one the attributes of the object you're trying to pickle until you find the problematic one(s) ? Something like: class MyClass(object): ... def __getstate__(self): del self.foo return self.__dict__ Then do the same to the class of self.foo, and so on recursively, until you find the real culprit. HTH, George -- http://mail.python.org/mailman/listinfo/python-list