-
-
Notifications
You must be signed in to change notification settings - Fork 182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when trying to pickle numpy.dtype.__class__ object for numpy >= 1.21 #434
Comments
a hint how this could be solved or better why plain vanilla pickle handles without any issue was given by @seberg on the aforementeioned numpy issue/pr #18325. |
The error actually looks similar to issue ( #56 ) |
Hope some of my thoughts are somehow helpful in finding solution for all similar. For example make _dill.save_type awareof hat there could exists copyreg.pickle table entries for |
it should be handled by: 5da2543 |
Hm it at least looks like. EDIT
|
Just came across an error causes by breaking changes in numpy 1.20 (may be related to #405 ) which persists in dill with numpy 1.21 while the it is resolved in this version for plain vanilla pickle.
The following code causes the issue:
Will result in the following error
_pickle.PicklingError: Can't pickle <class 'numpy.dtype[int64]'>: it's not found as numpy.dtype[int64]
while
returns the resulting pickle string as expected.
python version: >= 3.7
numpy: 1.21
dill: 0.3.4 (fresh download from pypi in tox managed virtual env)
This error seems to be dill side residue of numpy issue #18325 (details) which was fixed for plain vanilla pickle in numpy >=1.21.
The only hint i have is that dill tries to use the
__qualname__
or__name__
of the dtypes class to restore the dtype. At least it passes that as name to StockPickler.save_type on linepython3.7/site-packages/dill/_dill.py(1439)save_type()
The text was updated successfully, but these errors were encountered: