diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 53b8a52e1..9f23dfc5e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -133,7 +133,7 @@ repos: name: mypy-storage additional_dependencies: - aiohttp - - gcloud-aio-auth>=5.3.0 + - gcloud-aio-auth>=5.3.2 - rsa - types-aiofiles - types-requests diff --git a/storage/gcloud/aio/storage/storage.py b/storage/gcloud/aio/storage/storage.py index 492dae456..b75fc6c15 100644 --- a/storage/gcloud/aio/storage/storage.py +++ b/storage/gcloud/aio/storage/storage.py @@ -591,12 +591,14 @@ async def _download( # aiohttp and requests automatically decompress the body if this # argument is not passed. We assume that if the Accept-Encoding header # is present, then the client will handle the decompression - auto_decompress = 'accept-encoding' not in {k.lower() for k in headers} + auto_decompress = None # inherit the Session default setting + if 'accept-encoding' not in {k.lower() for k in headers}: + auto_decompress = False s = AioSession(session) if session else self.session data: bytes - if not auto_decompress and BUILD_GCLOUD_REST: + if auto_decompress is False and BUILD_GCLOUD_REST: # Requests lib has a different way of reading compressed data. We # must pass the stream=True argument and read the response using # the 'raw' property. diff --git a/storage/poetry.lock b/storage/poetry.lock index e87f4b794..472b9ebfc 100644 --- a/storage/poetry.lock +++ b/storage/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.7.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.2 and should not be changed by hand. [[package]] name = "aiofiles" @@ -404,7 +404,7 @@ files = [ [[package]] name = "gcloud-aio-auth" -version = "5.3.0" +version = "5.3.1" description = "Python Client for Google Cloud Auth" optional = false python-versions = ">= 3.8, < 4.0" diff --git a/storage/poetry.rest.lock b/storage/poetry.rest.lock index faf3d22b7..bf5a4cc1d 100644 --- a/storage/poetry.rest.lock +++ b/storage/poetry.rest.lock @@ -277,7 +277,7 @@ test = ["pytest (>=6)"] [[package]] name = "gcloud-rest-auth" -version = "5.3.0" +version = "5.3.1" description = "Python Client for Google Cloud Auth" optional = false python-versions = ">= 3.8, < 4.0" diff --git a/storage/pyproject.rest.toml b/storage/pyproject.rest.toml index cb5f65235..ca4d95ead 100644 --- a/storage/pyproject.rest.toml +++ b/storage/pyproject.rest.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "gcloud-rest-storage" -version = "9.3.0" +version = "9.3.1" description = "Python Client for Google Cloud Storage" readme = "README.rst" diff --git a/storage/pyproject.toml b/storage/pyproject.toml index 0b9db8ad4..8bb062c07 100644 --- a/storage/pyproject.toml +++ b/storage/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "gcloud-aio-storage" -version = "9.3.0" +version = "9.3.1" description = "Python Client for Google Cloud Storage" readme = "README.rst"