Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Pubsub messages and channel names are forced to be ASCII strings on Python 2 #146

Closed
ludwigschwardt opened this issue Mar 13, 2017 · 1 comment

Comments

@ludwigschwardt
Copy link
Collaborator

Pubsub message strings (and channel names) are explicitly encoded to the default encoding, which is a problem for the usual Python 2 strings.

Here is a simple example that breaks fakeredis but not redis-py on Python 2.7.13:

r = fakeredis.FakeStrictRedis()
p = r.pubsub()
p.subscribe('\xff')
# UnicodeDecodeError: 'ascii' codec can't decode byte 0xff in position 0: ordinal not in range(128)
p.subscribe('test')
r.publish('test', '\xff')
# UnicodeDecodeError: 'ascii' codec can't decode byte 0xff in position 0: ordinal not in range(128)
@bmerry
Copy link
Collaborator

bmerry commented Mar 22, 2018

Fixed in 0.10.1.

@bmerry bmerry closed this as completed Mar 22, 2018
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants