Skip to content

Commit ac92e0c

Browse files
authored
Use disable_decoding in async read_response. (#3042)
1 parent a60d25e commit ac92e0c

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

CHANGES

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
* Fix async `read_response` to use `disable_decoding`.
12
* Add 'aclose()' methods to async classes, deprecate async close().
23
* Fix #2831, add auto_close_connection_pool=True arg to asyncio.Redis.from_url()
34
* Fix incorrect redis.asyncio.Cluster type hint for `retry_on_error`

redis/_parsers/hiredis.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,16 @@ async def read_response(
198198
if not self._connected:
199199
raise ConnectionError(SERVER_CLOSED_CONNECTION_ERROR) from None
200200

201-
response = self._reader.gets()
201+
if disable_decoding:
202+
response = self._reader.gets(False)
203+
else:
204+
response = self._reader.gets()
202205
while response is False:
203206
await self.read_from_socket()
204-
response = self._reader.gets()
207+
if disable_decoding:
208+
response = self._reader.gets(False)
209+
else:
210+
response = self._reader.gets()
205211

206212
# if the response is a ConnectionError or the response is a list and
207213
# the first item is a ConnectionError, raise it as something bad

0 commit comments

Comments
 (0)