Skip to content
This repository has been archived by the owner on Jan 9, 2024. It is now read-only.

decode_responses for python3 #447

Answered by Grokzen
charlez asked this question in Q&A
Apr 14, 2021 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

@charlez This is not something that i enforce from my lib per say, but it is something that upstream package redis-py enforces and requires the user to make a choice.

Taken from their README.md file

...
By default, all responses are returned as bytes in Python 3 and str in Python 2. The user is responsible for decoding to Python 3 strings or Python 2 unicode objects.

If all string responses from a client should be decoded, the user can specify decode_responses=True to Redis.__init__. In this case, any Redis command that returns a string type will be decoded with the encoding specified.

The default encoding is "utf-8", but this can be customized with the encoding argument to the redis.Re…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@charlez
Comment options

@Grokzen
Comment options

@andymccurdy
Comment options

Answer selected by charlez
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants