BUG: Unpacking PY2 msgpack in PY3 · Issue #12142 · pandas-dev/pandas (original) (raw)
Navigation Menu
- Explore
- Pricing
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Appearance settings
Description
In #10686, I should have made all the strings in encode
Unicode strings. Now 'abc'
packed in P2 becomes (or rather remains as) b'abc'
when unpacked in P3. This I think is the desired behavior (bytes remain as bytes and text remains as text), but it causes errors in decode
, because, for example, 'typ'
(==u'type'
in P2) is expected while b'typ'
(=='typ'
in P2) is the key.
Reading in the other direction is fine because P2 is more tolerant of these things.
To reproduce this,
(P2) python generate_legacy_storage_files.py your_dir msgpack
(P3) pandas.read_msgpack(the_file_just_created)