diff --git a/src/urllib3/connectionpool.py b/src/urllib3/connectionpool.py index 52bb8657fc..c952dcbebb 100644 --- a/src/urllib3/connectionpool.py +++ b/src/urllib3/connectionpool.py @@ -556,7 +556,7 @@ def _make_request( # HTTP version http_version, response.status, - response.length_remaining, # type: ignore[attr-defined] + response.length_remaining, ) return response diff --git a/src/urllib3/response.py b/src/urllib3/response.py index 6a811ad513..47e75fd171 100644 --- a/src/urllib3/response.py +++ b/src/urllib3/response.py @@ -344,6 +344,7 @@ def __init__( self.chunked = True self._decoder: ContentDecoder | None = None + self.length_remaining: int | None def get_redirect_location(self) -> str | None | Literal[False]: """