-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Type inference does not work with byte buffers #11
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
Comments
I've pushed a new branch of redis-py called "newapi". It's a completely refactored client. There are numerous changes under the hood, including pipelining, a more consistent interface across commands, and removal of "magic value decoding". I've made an effort to be backwards compatible where possible, issuing DeprecationWarnings for things that will go away in a future version. Hopefully this will give people time to upgrade their code. Nevertheless, there are several backwards incompatible changes, most notably that the Redis client no longer attempts to be "clever" about casting values to ints and floats if the data looks like a number. For example:
There are tests for all the commands and I should have a working set of tests for pipelining and connection pooling this evening. If you have some spare cycles, it'd be awesome if you could give the new client a test drive and provide any feedback. Thanks! |
This issue has been resolved in the 1.34 release of redis-py. |
Thanks Andy, this is excellent. Sidenote: thanks also for making the naming of the commands/methods consistent-- the old style was driving me insane. |
adding security policy
The following code (the last lines of
_get_value
) does not work properly if the value stored in Redis is a byte buffer.Ignoring the general type inference issues (discussed on the Redis mailing list here: http://groups.google.com/group/redis-db/browse_thread/thread/9888eb9ff383c90c), there is a serious issue with the
data.decode
call in the event that the data is representative of a byte buffer. In this case, decoding the buffer with a codec results in an incorrect response being returned to the client. Instead,data
itself should be returned to the caller.The text was updated successfully, but these errors were encountered: