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

script_load cannot work with bytes #150

Open
PCManticore opened this issue Aug 22, 2018 · 0 comments
Open

script_load cannot work with bytes #150

PCManticore opened this issue Aug 22, 2018 · 0 comments

Comments

@PCManticore
Copy link

Currently if you try to pass a bytes object to script_load you'll get a similar error to the following:

  ...
  File "/Users/claudiu/.pyenv/versions/3.6.5/lib/python3.6/site-packages/mockredis/client.py", line 1322, in script_load
    sha_digest = sha1(script.encode("utf-8")).hexdigest()
AttributeError: 'bytes' object has no attribute 'encode'

It seems that script_load is currently expecting to be called with a string object here: https://github.com/locationlabs/mockredis/blob/master/mockredis/client.py#L1333

But script_load in redis can work with both bytes and strings, which should probably be allowed in mockredis as well.

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