So, following the excellent suggestion in both this answer and that answer, I decided to replace a whole bunch of encode/decode
to/from UTF-8 all over the place by a single:
rdb = redis.StrictRedis(..., encoding='utf-8', decode_responses=True)
But then, as others have pointed out in comments to the answers above, that connection is then unable to "handle binary data". (Small point: I slightly disagree with that: "decode_responses
" is well-named: the responses are unconditionally converted from binary to string, but arbitrary binary data can still be stored, just not retrieved).
So, absent of having a way to briefly override the decode_responses
setting for a single query, I was wondering if there was a way to derive a new client from an existing one, with largely the same parameters? That way, I could make a new client with decode_responses=False
just to retrieve data I know to be binary.