Skip to content

pandas.read_msgpack(None) returns [78, 111, 110, 101] #10369

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

Closed
sergeny opened this issue Jun 17, 2015 · 3 comments · Fixed by #10490
Closed

pandas.read_msgpack(None) returns [78, 111, 110, 101] #10369

sergeny opened this issue Jun 17, 2015 · 3 comments · Fixed by #10490
Labels
Error Reporting Incorrect or improved errors from pandas
Milestone

Comments

@sergeny
Copy link

sergeny commented Jun 17, 2015

It should return an error, as that's what it most likely is.

If someone is really sending empty msgpacks out there to transmit [78, 111, 110, 101], they could add a special case.

@jreback
Copy link
Contributor

jreback commented Jun 17, 2015

yep, that should raise. The idea is you can simply pass a string or a file-like object (e.g. StringIO). So needs to be a test for a .read method on the file-like, and otherwise raise. Want to do a pull-request?

@jreback jreback added Error Reporting Incorrect or improved errors from pandas Msgpack labels Jun 17, 2015
@jreback jreback added this to the 0.17.0 milestone Jun 17, 2015
@sergeny
Copy link
Author

sergeny commented Jun 17, 2015

Yes, but it should work for strings, which have no read(). For example, the following should succeed:

pandas.read_msgpack('\x87\xa5index\x85\xa5dtype\x07\xa3typ\xa5index\xa5klass\xaaInt64Index\xa4data\xa8\x00\x00\x00\x00\x00\x00\x00\x00\xa4name\xc0\xa4name\xc0\xa3typ\xa6series\xa8compress\xc0\xa5klass\xa6Series\xa5dtype\x07\xa4data\xa8\x01\x00\x00\x00\x00\x00\x00\x00')

@jreback
Copy link
Contributor

jreback commented Jun 17, 2015

strings are allowed now
you just need to exclude not (strings or file-like)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Error Reporting Incorrect or improved errors from pandas
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants