diff options
author | Sebastian Berg <sebastian@sipsolutions.net> | 2020-11-19 12:53:42 -0600 |
---|---|---|
committer | Sebastian Berg <sebastian@sipsolutions.net> | 2020-11-19 13:09:37 -0600 |
commit | 5f316a85dd205cb0a6134a5a1e6b5bc76943f17c (patch) | |
tree | 287bb2c8036eb103dd1c4e1b726729797aecc49d /numpy/lib/function_base.py | |
parent | 44d66b8a3fbc88998b98d7bffc20bc9fa89251a5 (diff) | |
download | numpy-5f316a85dd205cb0a6134a5a1e6b5bc76943f17c.tar.gz |
BUG: Fix pickling of scalars with NPY_LISTPICKLE
Structured void scalars (or potentially other dtypes using LISTPICKLE)
were incorrectly pickled and unpickled previously.
While the pickled value was valid and could have been used to
reconstruct the data, the reconstruction itself would always fail.
The approach here is to always pickle the full array and use the
arrays pickle/unpickle machinery which handles structured void
correctly. Future work could improve on this probably.
In the (hopefully impossible) case that someone tries to unpickle
a numpy object scalar, the code is now fixed to return the pickled
value unmodified (but INCREF'd), however a deprecation-warning
is given, since such an object should never be created.
Diffstat (limited to 'numpy/lib/function_base.py')
0 files changed, 0 insertions, 0 deletions