We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
`disable_decoding` not used in async version of `read_response`.
**Version**: redis-py version - 5.0.0 (I still see it on main)

**Description**:
Is there a reason why `disable_decoding` is not being used in async version of `read_response`? 
It seems like there's no async way to get raw data (`NEVER_DECODE`) from Redis.
Are there any plans of adding the `NEVER_DECODE` support for async `read_response`?
We want to save pickled data (not compatible with `UTF-8`) in Redis, and for now we will use the workaround (as in https://github.com/redis/redis-py/issues/1006#issuecomment-1100506453 ), but it's not a very clean solution.

redis/_parsers/hiredis.py:204
https://github.com/redis/redis-py/blob/d3a3ada03e080f39144807c9fbe44876c40e0548/redis/_parsers/hiredis.py#L192-L217



--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `redis/_parsers/hiredis.py`
Content:
```
1 import asyncio
2 import socket
3 import sys
4 from typing import Callable, List, Optional, Union
5 
6 if sys.version_info.major >= 3 and sys.version_info.minor >= 11:
7     from asyncio import timeout as async_timeout
8 else:
9     from async_timeout import timeout as async_timeout
10 
11 from redis.compat import TypedDict
12 
13 from ..exceptions import ConnectionError, InvalidResponse, RedisError
14 from ..typing import EncodableT
15 from ..utils import HIREDIS_AVAILABLE
16 from .base import AsyncBaseParser, BaseParser
17 from .socket import (
18     NONBLOCKING_EXCEPTION_ERROR_NUMBERS,
19     NONBLOCKING_EXCEPTIONS,
20     SENTINEL,
21     SERVER_CLOSED_CONNECTION_ERROR,
22 )
23 
24 
25 class _HiredisReaderArgs(TypedDict, total=False):
26     protocolError: Callable[[str], Exception]
27     replyError: Callable[[str], Exception]
28     encoding: Optional[str]
29     errors: Optional[str]
30 
31 
32 class _HiredisParser(BaseParser):
33     "Parser class for connections using Hiredis"
34 
35     def __init__(self, socket_read_size):
36         if not HIREDIS_AVAILABLE:
37             raise RedisError("Hiredis is not installed")
38         self.socket_read_size = socket_read_size
39         self._buffer = bytearray(socket_read_size)
40 
41     def __del__(self):
42         try:
43             self.on_disconnect()
44         except Exception:
45             pass
46 
47     def on_connect(self, connection, **kwargs):
48         import hiredis
49 
50         self._sock = connection._sock
51         self._socket_timeout = connection.socket_timeout
52         kwargs = {
53             "protocolError": InvalidResponse,
54             "replyError": self.parse_error,
55             "errors": connection.encoder.encoding_errors,
56         }
57 
58         if connection.encoder.decode_responses:
59             kwargs["encoding"] = connection.encoder.encoding
60         self._reader = hiredis.Reader(**kwargs)
61         self._next_response = False
62 
63     def on_disconnect(self):
64         self._sock = None
65         self._reader = None
66         self._next_response = False
67 
68     def can_read(self, timeout):
69         if not self._reader:
70             raise ConnectionError(SERVER_CLOSED_CONNECTION_ERROR)
71 
72         if self._next_response is False:
73             self._next_response = self._reader.gets()
74             if self._next_response is False:
75                 return self.read_from_socket(timeout=timeout, raise_on_timeout=False)
76         return True
77 
78     def read_from_socket(self, timeout=SENTINEL, raise_on_timeout=True):
79         sock = self._sock
80         custom_timeout = timeout is not SENTINEL
81         try:
82             if custom_timeout:
83                 sock.settimeout(timeout)
84             bufflen = self._sock.recv_into(self._buffer)
85             if bufflen == 0:
86                 raise ConnectionError(SERVER_CLOSED_CONNECTION_ERROR)
87             self._reader.feed(self._buffer, 0, bufflen)
88             # data was read from the socket and added to the buffer.
89             # return True to indicate that data was read.
90             return True
91         except socket.timeout:
92             if raise_on_timeout:
93                 raise TimeoutError("Timeout reading from socket")
94             return False
95         except NONBLOCKING_EXCEPTIONS as ex:
96             # if we're in nonblocking mode and the recv raises a
97             # blocking error, simply return False indicating that
98             # there's no data to be read. otherwise raise the
99             # original exception.
100             allowed = NONBLOCKING_EXCEPTION_ERROR_NUMBERS.get(ex.__class__, -1)
101             if not raise_on_timeout and ex.errno == allowed:
102                 return False
103             raise ConnectionError(f"Error while reading from socket: {ex.args}")
104         finally:
105             if custom_timeout:
106                 sock.settimeout(self._socket_timeout)
107 
108     def read_response(self, disable_decoding=False):
109         if not self._reader:
110             raise ConnectionError(SERVER_CLOSED_CONNECTION_ERROR)
111 
112         # _next_response might be cached from a can_read() call
113         if self._next_response is not False:
114             response = self._next_response
115             self._next_response = False
116             return response
117 
118         if disable_decoding:
119             response = self._reader.gets(False)
120         else:
121             response = self._reader.gets()
122 
123         while response is False:
124             self.read_from_socket()
125             if disable_decoding:
126                 response = self._reader.gets(False)
127             else:
128                 response = self._reader.gets()
129         # if the response is a ConnectionError or the response is a list and
130         # the first item is a ConnectionError, raise it as something bad
131         # happened
132         if isinstance(response, ConnectionError):
133             raise response
134         elif (
135             isinstance(response, list)
136             and response
137             and isinstance(response[0], ConnectionError)
138         ):
139             raise response[0]
140         return response
141 
142 
143 class _AsyncHiredisParser(AsyncBaseParser):
144     """Async implementation of parser class for connections using Hiredis"""
145 
146     __slots__ = ("_reader",)
147 
148     def __init__(self, socket_read_size: int):
149         if not HIREDIS_AVAILABLE:
150             raise RedisError("Hiredis is not available.")
151         super().__init__(socket_read_size=socket_read_size)
152         self._reader = None
153 
154     def on_connect(self, connection):
155         import hiredis
156 
157         self._stream = connection._reader
158         kwargs: _HiredisReaderArgs = {
159             "protocolError": InvalidResponse,
160             "replyError": self.parse_error,
161         }
162         if connection.encoder.decode_responses:
163             kwargs["encoding"] = connection.encoder.encoding
164             kwargs["errors"] = connection.encoder.encoding_errors
165 
166         self._reader = hiredis.Reader(**kwargs)
167         self._connected = True
168 
169     def on_disconnect(self):
170         self._connected = False
171 
172     async def can_read_destructive(self):
173         if not self._connected:
174             raise ConnectionError(SERVER_CLOSED_CONNECTION_ERROR)
175         if self._reader.gets():
176             return True
177         try:
178             async with async_timeout(0):
179                 return await self.read_from_socket()
180         except asyncio.TimeoutError:
181             return False
182 
183     async def read_from_socket(self):
184         buffer = await self._stream.read(self._read_size)
185         if not buffer or not isinstance(buffer, bytes):
186             raise ConnectionError(SERVER_CLOSED_CONNECTION_ERROR) from None
187         self._reader.feed(buffer)
188         # data was read from the socket and added to the buffer.
189         # return True to indicate that data was read.
190         return True
191 
192     async def read_response(
193         self, disable_decoding: bool = False
194     ) -> Union[EncodableT, List[EncodableT]]:
195         # If `on_disconnect()` has been called, prohibit any more reads
196         # even if they could happen because data might be present.
197         # We still allow reads in progress to finish
198         if not self._connected:
199             raise ConnectionError(SERVER_CLOSED_CONNECTION_ERROR) from None
200 
201         response = self._reader.gets()
202         while response is False:
203             await self.read_from_socket()
204             response = self._reader.gets()
205 
206         # if the response is a ConnectionError or the response is a list and
207         # the first item is a ConnectionError, raise it as something bad
208         # happened
209         if isinstance(response, ConnectionError):
210             raise response
211         elif (
212             isinstance(response, list)
213             and response
214             and isinstance(response[0], ConnectionError)
215         ):
216             raise response[0]
217         return response
218
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/redis/_parsers/hiredis.py b/redis/_parsers/hiredis.py
--- a/redis/_parsers/hiredis.py
+++ b/redis/_parsers/hiredis.py
@@ -198,10 +198,16 @@
         if not self._connected:
             raise ConnectionError(SERVER_CLOSED_CONNECTION_ERROR) from None
 
-        response = self._reader.gets()
+        if disable_decoding:
+            response = self._reader.gets(False)
+        else:
+            response = self._reader.gets()
         while response is False:
             await self.read_from_socket()
-            response = self._reader.gets()
+            if disable_decoding:
+                response = self._reader.gets(False)
+            else:
+                response = self._reader.gets()
 
         # if the response is a ConnectionError or the response is a list and
         # the first item is a ConnectionError, raise it as something bad

{"golden_diff": "diff --git a/redis/_parsers/hiredis.py b/redis/_parsers/hiredis.py\n--- a/redis/_parsers/hiredis.py\n+++ b/redis/_parsers/hiredis.py\n@@ -198,10 +198,16 @@\n         if not self._connected:\n             raise ConnectionError(SERVER_CLOSED_CONNECTION_ERROR) from None\n \n-        response = self._reader.gets()\n+        if disable_decoding:\n+            response = self._reader.gets(False)\n+        else:\n+            response = self._reader.gets()\n         while response is False:\n             await self.read_from_socket()\n-            response = self._reader.gets()\n+            if disable_decoding:\n+                response = self._reader.gets(False)\n+            else:\n+                response = self._reader.gets()\n \n         # if the response is a ConnectionError or the response is a list and\n         # the first item is a ConnectionError, raise it as something bad\n", "issue": "`disable_decoding` not used in async version of `read_response`.\n**Version**: redis-py version - 5.0.0 (I still see it on main)\r\n\r\n**Description**:\r\nIs there a reason why `disable_decoding` is not being used in async version of `read_response`? \r\nIt seems like there's no async way to get raw data (`NEVER_DECODE`) from Redis.\r\nAre there any plans of adding the `NEVER_DECODE` support for async `read_response`?\r\nWe want to save pickled data (not compatible with `UTF-8`) in Redis, and for now we will use the workaround (as in https://github.com/redis/redis-py/issues/1006#issuecomment-1100506453 ), but it's not a very clean solution.\r\n\r\nredis/_parsers/hiredis.py:204\r\nhttps://github.com/redis/redis-py/blob/d3a3ada03e080f39144807c9fbe44876c40e0548/redis/_parsers/hiredis.py#L192-L217\r\n\r\n\n", "before_files": [{"content": "import asyncio\nimport socket\nimport sys\nfrom typing import Callable, List, Optional, Union\n\nif sys.version_info.major >= 3 and sys.version_info.minor >= 11:\n    from asyncio import timeout as async_timeout\nelse:\n    from async_timeout import timeout as async_timeout\n\nfrom redis.compat import TypedDict\n\nfrom ..exceptions import ConnectionError, InvalidResponse, RedisError\nfrom ..typing import EncodableT\nfrom ..utils import HIREDIS_AVAILABLE\nfrom .base import AsyncBaseParser, BaseParser\nfrom .socket import (\n    NONBLOCKING_EXCEPTION_ERROR_NUMBERS,\n    NONBLOCKING_EXCEPTIONS,\n    SENTINEL,\n    SERVER_CLOSED_CONNECTION_ERROR,\n)\n\n\nclass _HiredisReaderArgs(TypedDict, total=False):\n    protocolError: Callable[[str], Exception]\n    replyError: Callable[[str], Exception]\n    encoding: Optional[str]\n    errors: Optional[str]\n\n\nclass _HiredisParser(BaseParser):\n    \"Parser class for connections using Hiredis\"\n\n    def __init__(self, socket_read_size):\n        if not HIREDIS_AVAILABLE:\n            raise RedisError(\"Hiredis is not installed\")\n        self.socket_read_size = socket_read_size\n        self._buffer = bytearray(socket_read_size)\n\n    def __del__(self):\n        try:\n            self.on_disconnect()\n        except Exception:\n            pass\n\n    def on_connect(self, connection, **kwargs):\n        import hiredis\n\n        self._sock = connection._sock\n        self._socket_timeout = connection.socket_timeout\n        kwargs = {\n            \"protocolError\": InvalidResponse,\n            \"replyError\": self.parse_error,\n            \"errors\": connection.encoder.encoding_errors,\n        }\n\n        if connection.encoder.decode_responses:\n            kwargs[\"encoding\"] = connection.encoder.encoding\n        self._reader = hiredis.Reader(**kwargs)\n        self._next_response = False\n\n    def on_disconnect(self):\n        self._sock = None\n        self._reader = None\n        self._next_response = False\n\n    def can_read(self, timeout):\n        if not self._reader:\n            raise ConnectionError(SERVER_CLOSED_CONNECTION_ERROR)\n\n        if self._next_response is False:\n            self._next_response = self._reader.gets()\n            if self._next_response is False:\n                return self.read_from_socket(timeout=timeout, raise_on_timeout=False)\n        return True\n\n    def read_from_socket(self, timeout=SENTINEL, raise_on_timeout=True):\n        sock = self._sock\n        custom_timeout = timeout is not SENTINEL\n        try:\n            if custom_timeout:\n                sock.settimeout(timeout)\n            bufflen = self._sock.recv_into(self._buffer)\n            if bufflen == 0:\n                raise ConnectionError(SERVER_CLOSED_CONNECTION_ERROR)\n            self._reader.feed(self._buffer, 0, bufflen)\n            # data was read from the socket and added to the buffer.\n            # return True to indicate that data was read.\n            return True\n        except socket.timeout:\n            if raise_on_timeout:\n                raise TimeoutError(\"Timeout reading from socket\")\n            return False\n        except NONBLOCKING_EXCEPTIONS as ex:\n            # if we're in nonblocking mode and the recv raises a\n            # blocking error, simply return False indicating that\n            # there's no data to be read. otherwise raise the\n            # original exception.\n            allowed = NONBLOCKING_EXCEPTION_ERROR_NUMBERS.get(ex.__class__, -1)\n            if not raise_on_timeout and ex.errno == allowed:\n                return False\n            raise ConnectionError(f\"Error while reading from socket: {ex.args}\")\n        finally:\n            if custom_timeout:\n                sock.settimeout(self._socket_timeout)\n\n    def read_response(self, disable_decoding=False):\n        if not self._reader:\n            raise ConnectionError(SERVER_CLOSED_CONNECTION_ERROR)\n\n        # _next_response might be cached from a can_read() call\n        if self._next_response is not False:\n            response = self._next_response\n            self._next_response = False\n            return response\n\n        if disable_decoding:\n            response = self._reader.gets(False)\n        else:\n            response = self._reader.gets()\n\n        while response is False:\n            self.read_from_socket()\n            if disable_decoding:\n                response = self._reader.gets(False)\n            else:\n                response = self._reader.gets()\n        # if the response is a ConnectionError or the response is a list and\n        # the first item is a ConnectionError, raise it as something bad\n        # happened\n        if isinstance(response, ConnectionError):\n            raise response\n        elif (\n            isinstance(response, list)\n            and response\n            and isinstance(response[0], ConnectionError)\n        ):\n            raise response[0]\n        return response\n\n\nclass _AsyncHiredisParser(AsyncBaseParser):\n    \"\"\"Async implementation of parser class for connections using Hiredis\"\"\"\n\n    __slots__ = (\"_reader\",)\n\n    def __init__(self, socket_read_size: int):\n        if not HIREDIS_AVAILABLE:\n            raise RedisError(\"Hiredis is not available.\")\n        super().__init__(socket_read_size=socket_read_size)\n        self._reader = None\n\n    def on_connect(self, connection):\n        import hiredis\n\n        self._stream = connection._reader\n        kwargs: _HiredisReaderArgs = {\n            \"protocolError\": InvalidResponse,\n            \"replyError\": self.parse_error,\n        }\n        if connection.encoder.decode_responses:\n            kwargs[\"encoding\"] = connection.encoder.encoding\n            kwargs[\"errors\"] = connection.encoder.encoding_errors\n\n        self._reader = hiredis.Reader(**kwargs)\n        self._connected = True\n\n    def on_disconnect(self):\n        self._connected = False\n\n    async def can_read_destructive(self):\n        if not self._connected:\n            raise ConnectionError(SERVER_CLOSED_CONNECTION_ERROR)\n        if self._reader.gets():\n            return True\n        try:\n            async with async_timeout(0):\n                return await self.read_from_socket()\n        except asyncio.TimeoutError:\n            return False\n\n    async def read_from_socket(self):\n        buffer = await self._stream.read(self._read_size)\n        if not buffer or not isinstance(buffer, bytes):\n            raise ConnectionError(SERVER_CLOSED_CONNECTION_ERROR) from None\n        self._reader.feed(buffer)\n        # data was read from the socket and added to the buffer.\n        # return True to indicate that data was read.\n        return True\n\n    async def read_response(\n        self, disable_decoding: bool = False\n    ) -> Union[EncodableT, List[EncodableT]]:\n        # If `on_disconnect()` has been called, prohibit any more reads\n        # even if they could happen because data might be present.\n        # We still allow reads in progress to finish\n        if not self._connected:\n            raise ConnectionError(SERVER_CLOSED_CONNECTION_ERROR) from None\n\n        response = self._reader.gets()\n        while response is False:\n            await self.read_from_socket()\n            response = self._reader.gets()\n\n        # if the response is a ConnectionError or the response is a list and\n        # the first item is a ConnectionError, raise it as something bad\n        # happened\n        if isinstance(response, ConnectionError):\n            raise response\n        elif (\n            isinstance(response, list)\n            and response\n            and isinstance(response[0], ConnectionError)\n        ):\n            raise response[0]\n        return response\n", "path": "redis/_parsers/hiredis.py"}], "after_files": [{"content": "import asyncio\nimport socket\nimport sys\nfrom typing import Callable, List, Optional, Union\n\nif sys.version_info.major >= 3 and sys.version_info.minor >= 11:\n    from asyncio import timeout as async_timeout\nelse:\n    from async_timeout import timeout as async_timeout\n\nfrom redis.compat import TypedDict\n\nfrom ..exceptions import ConnectionError, InvalidResponse, RedisError\nfrom ..typing import EncodableT\nfrom ..utils import HIREDIS_AVAILABLE\nfrom .base import AsyncBaseParser, BaseParser\nfrom .socket import (\n    NONBLOCKING_EXCEPTION_ERROR_NUMBERS,\n    NONBLOCKING_EXCEPTIONS,\n    SENTINEL,\n    SERVER_CLOSED_CONNECTION_ERROR,\n)\n\n\nclass _HiredisReaderArgs(TypedDict, total=False):\n    protocolError: Callable[[str], Exception]\n    replyError: Callable[[str], Exception]\n    encoding: Optional[str]\n    errors: Optional[str]\n\n\nclass _HiredisParser(BaseParser):\n    \"Parser class for connections using Hiredis\"\n\n    def __init__(self, socket_read_size):\n        if not HIREDIS_AVAILABLE:\n            raise RedisError(\"Hiredis is not installed\")\n        self.socket_read_size = socket_read_size\n        self._buffer = bytearray(socket_read_size)\n\n    def __del__(self):\n        try:\n            self.on_disconnect()\n        except Exception:\n            pass\n\n    def on_connect(self, connection, **kwargs):\n        import hiredis\n\n        self._sock = connection._sock\n        self._socket_timeout = connection.socket_timeout\n        kwargs = {\n            \"protocolError\": InvalidResponse,\n            \"replyError\": self.parse_error,\n            \"errors\": connection.encoder.encoding_errors,\n        }\n\n        if connection.encoder.decode_responses:\n            kwargs[\"encoding\"] = connection.encoder.encoding\n        self._reader = hiredis.Reader(**kwargs)\n        self._next_response = False\n\n    def on_disconnect(self):\n        self._sock = None\n        self._reader = None\n        self._next_response = False\n\n    def can_read(self, timeout):\n        if not self._reader:\n            raise ConnectionError(SERVER_CLOSED_CONNECTION_ERROR)\n\n        if self._next_response is False:\n            self._next_response = self._reader.gets()\n            if self._next_response is False:\n                return self.read_from_socket(timeout=timeout, raise_on_timeout=False)\n        return True\n\n    def read_from_socket(self, timeout=SENTINEL, raise_on_timeout=True):\n        sock = self._sock\n        custom_timeout = timeout is not SENTINEL\n        try:\n            if custom_timeout:\n                sock.settimeout(timeout)\n            bufflen = self._sock.recv_into(self._buffer)\n            if bufflen == 0:\n                raise ConnectionError(SERVER_CLOSED_CONNECTION_ERROR)\n            self._reader.feed(self._buffer, 0, bufflen)\n            # data was read from the socket and added to the buffer.\n            # return True to indicate that data was read.\n            return True\n        except socket.timeout:\n            if raise_on_timeout:\n                raise TimeoutError(\"Timeout reading from socket\")\n            return False\n        except NONBLOCKING_EXCEPTIONS as ex:\n            # if we're in nonblocking mode and the recv raises a\n            # blocking error, simply return False indicating that\n            # there's no data to be read. otherwise raise the\n            # original exception.\n            allowed = NONBLOCKING_EXCEPTION_ERROR_NUMBERS.get(ex.__class__, -1)\n            if not raise_on_timeout and ex.errno == allowed:\n                return False\n            raise ConnectionError(f\"Error while reading from socket: {ex.args}\")\n        finally:\n            if custom_timeout:\n                sock.settimeout(self._socket_timeout)\n\n    def read_response(self, disable_decoding=False):\n        if not self._reader:\n            raise ConnectionError(SERVER_CLOSED_CONNECTION_ERROR)\n\n        # _next_response might be cached from a can_read() call\n        if self._next_response is not False:\n            response = self._next_response\n            self._next_response = False\n            return response\n\n        if disable_decoding:\n            response = self._reader.gets(False)\n        else:\n            response = self._reader.gets()\n\n        while response is False:\n            self.read_from_socket()\n            if disable_decoding:\n                response = self._reader.gets(False)\n            else:\n                response = self._reader.gets()\n        # if the response is a ConnectionError or the response is a list and\n        # the first item is a ConnectionError, raise it as something bad\n        # happened\n        if isinstance(response, ConnectionError):\n            raise response\n        elif (\n            isinstance(response, list)\n            and response\n            and isinstance(response[0], ConnectionError)\n        ):\n            raise response[0]\n        return response\n\n\nclass _AsyncHiredisParser(AsyncBaseParser):\n    \"\"\"Async implementation of parser class for connections using Hiredis\"\"\"\n\n    __slots__ = (\"_reader\",)\n\n    def __init__(self, socket_read_size: int):\n        if not HIREDIS_AVAILABLE:\n            raise RedisError(\"Hiredis is not available.\")\n        super().__init__(socket_read_size=socket_read_size)\n        self._reader = None\n\n    def on_connect(self, connection):\n        import hiredis\n\n        self._stream = connection._reader\n        kwargs: _HiredisReaderArgs = {\n            \"protocolError\": InvalidResponse,\n            \"replyError\": self.parse_error,\n        }\n        if connection.encoder.decode_responses:\n            kwargs[\"encoding\"] = connection.encoder.encoding\n            kwargs[\"errors\"] = connection.encoder.encoding_errors\n\n        self._reader = hiredis.Reader(**kwargs)\n        self._connected = True\n\n    def on_disconnect(self):\n        self._connected = False\n\n    async def can_read_destructive(self):\n        if not self._connected:\n            raise ConnectionError(SERVER_CLOSED_CONNECTION_ERROR)\n        if self._reader.gets():\n            return True\n        try:\n            async with async_timeout(0):\n                return await self.read_from_socket()\n        except asyncio.TimeoutError:\n            return False\n\n    async def read_from_socket(self):\n        buffer = await self._stream.read(self._read_size)\n        if not buffer or not isinstance(buffer, bytes):\n            raise ConnectionError(SERVER_CLOSED_CONNECTION_ERROR) from None\n        self._reader.feed(buffer)\n        # data was read from the socket and added to the buffer.\n        # return True to indicate that data was read.\n        return True\n\n    async def read_response(\n        self, disable_decoding: bool = False\n    ) -> Union[EncodableT, List[EncodableT]]:\n        # If `on_disconnect()` has been called, prohibit any more reads\n        # even if they could happen because data might be present.\n        # We still allow reads in progress to finish\n        if not self._connected:\n            raise ConnectionError(SERVER_CLOSED_CONNECTION_ERROR) from None\n\n        if disable_decoding:\n            response = self._reader.gets(False)\n        else:\n            response = self._reader.gets()\n        while response is False:\n            await self.read_from_socket()\n            if disable_decoding:\n                response = self._reader.gets(False)\n            else:\n                response = self._reader.gets()\n\n        # if the response is a ConnectionError or the response is a list and\n        # the first item is a ConnectionError, raise it as something bad\n        # happened\n        if isinstance(response, ConnectionError):\n            raise response\n        elif (\n            isinstance(response, list)\n            and response\n            and isinstance(response[0], ConnectionError)\n        ):\n            raise response[0]\n        return response\n", "path": "redis/_parsers/hiredis.py"}]}