diff options
author | Pauli Virtanen <pav@iki.fi> | 2014-07-19 00:23:58 +0300 |
---|---|---|
committer | Pauli Virtanen <pav@iki.fi> | 2014-07-22 23:42:03 +0300 |
commit | 16f39c80f69ae4695f2f940ccdff8b26db3a2a01 (patch) | |
tree | dab647108acd39cb4d1bfd7ec21db70451993f62 /numpy/matrixlib/defmatrix.py | |
parent | 4008bb41414184d875af4f733a3ff3d303b94a4a (diff) | |
download | numpy-16f39c80f69ae4695f2f940ccdff8b26db3a2a01.tar.gz |
BUG: core: ensure unpickled dtype fields and names have correct types + coerce on Py3
That 'names' is a tuple and 'fields' a dict (when present) is assumed in
most of the code base, so check them during unpickling.
Also add coercion from bytes using ASCII codec on Python 3. This is
never triggered in the "usual" case of loading Py3-generated pickles on
Py3, but can occur if loading Py2 generated pickles with
pickle.load(f, encoding='bytes'), which sometimes is the only working
option.
The ASCII codec is probably the safest choice and likely covers most use
cases.
Diffstat (limited to 'numpy/matrixlib/defmatrix.py')
0 files changed, 0 insertions, 0 deletions