Skip to content
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

ENH: core: make unpickling with encoding='bytes' work #4888

Merged
merged 2 commits into from Jul 22, 2014

Commits on Jul 22, 2014

  1. ENH: core: make unpickling with encoding='bytes' work

    Make dtype.__setstate__ accept endian either as a byte string or unicode.
    
    Also fix a missing error return introduced in c355157, apparently
    mistake.
    pv committed Jul 22, 2014
    Copy the full SHA
    4008bb4 View commit details
    Browse the repository at this point in the history
  2. 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.
    pv committed Jul 22, 2014
    Copy the full SHA
    16f39c8 View commit details
    Browse the repository at this point in the history