dahlia / wikidata

Wikidata client library for Python

Home Page:https://pypi.org/project/Wikidata/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Entities cannot be pickled

nelson-liu opened this issue · comments

Seems like this would require moving away from WeakValueDictionary?

In [1]: from wikidata.client import Client

In [2]: import pickle

In [3]: c = Client()

In [4]: example = c.get("Q42")

In [5]: with open("test", "wb") as f:
   ...:     pickle.dump(example, f)
   ...:
   ...:
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-6-966820a5735d> in <module>
      1 with open("test", "wb") as f:
----> 2     pickle.dump(example, f)
      3
      4

AttributeError: Can't pickle local object 'WeakValueDictionary.__init__.<locals>.remove'