def __setstate__(self, state):
    self.__dict__ = state
self._cookies_lock = threading.RLock()


class Person(object):

    def __init__(self, name):
        self.name = name
self.cookies = MyCookieJar()
bob = Person('bob')
print(dumps(bob))
How to pickle a CookieJar?