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

Several incr/decr functions do not convert the value to bytes #164

Closed
bmerry opened this issue Nov 9, 2017 · 1 comment
Closed

Several incr/decr functions do not convert the value to bytes #164

bmerry opened this issue Nov 9, 2017 · 1 comment

Comments

@bmerry
Copy link
Collaborator

bmerry commented Nov 9, 2017

The implementations of decr, hincrby and hincrbyfloat store the int/float value internally, instead of the stringified version. This can lead to errors e.g.

>>> f = fakeredis.FakeStrictRedis()
>>> f.decr('key', 1)
-1
>>> f.append('key', 'x')
TypeError: unsupported operand type(s) for +=: 'int' and 'str'

I have a fix in a branch I am preparing for PR.

@bmerry
Copy link
Collaborator Author

bmerry commented Nov 10, 2017

This is a duplicate of #90, so I'm closing it.

@bmerry bmerry closed this as completed Nov 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant