diff options
author | Jon Dufresne <jon.dufresne@gmail.com> | 2020-04-13 11:19:51 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-13 11:19:51 -0700 |
commit | 0851c0db2b979c55f52a28eeb63bfa6898df8cb3 (patch) | |
tree | ca0256cc162024897d0cc081458ca1c0c97718c5 /redis/utils.py | |
parent | 5fa3fe5bb6fefb88a15cfb58462c1cf031b62d0f (diff) | |
download | redis-py-0851c0db2b979c55f52a28eeb63bfa6898df8cb3.tar.gz |
Fix str/bytes mixup in PythonParser.read_response() (#1324)
Calling str() on a bytes object can result in a BytesWarning being
emitted and usually indicates a mixup between byte and string handling.
Now, in the event of an invalid RESP response, use the repr value of the
raw response in the exception message.
Can further simplify the bytes/str handling by comparing the first byte
as a bytes object instead of converting it to str. The bytes literal is
available on all supported Pythons. This removes the need for the
compatibility function, byte_to_chr().
Diffstat (limited to 'redis/utils.py')
0 files changed, 0 insertions, 0 deletions