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

bytestring is returned as string #8

Open
benjaminweb opened this issue Jan 16, 2018 · 0 comments
Open

bytestring is returned as string #8

benjaminweb opened this issue Jan 16, 2018 · 0 comments

Comments

@benjaminweb
Copy link

benjaminweb commented Jan 16, 2018

I've isolated a minimum working example:

https://github.com/benjaminweb/redis_lua_bytes_bug

    def test_set_get(redisdb):
        set_get = redis_lua.load_script('set_get', 'lua').get_runner(redisdb)
        data = dict(value='foo bar')
        result = set_get(**data)
        pyredis = redisdb.get('fancykey')
        expected = data['value'].encode('utf-8')
        assert pyredis == expected
        print(pyredis)
>       assert result == expected
E       assert "b'foo bar'" == b'foo bar'

return str(value.decode()) nor return value fixed it, though.

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