You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Storage: download_to_file() decompresses gzip'd object even when passed "Accept-Encoding: gzip" #6035
Once the issue mentioned above is resolved and a new version of google-resumable-media-python is released, this library should:
Require a version of it >= the new version
Figure out what to do about the download_to_file() and download_to_filename() methods in blob.py [1] [2]. They currently look like they're supposed to download gzipped objects (those with Content-Encoding set to "gzip") in their compressed state, given that they add the "Accept-Encoding: gzip" header to the request. However, due to the issue mentioned above, they do not; they actually result in the decompressed bytes being written to the desired stream/file. Once this gets fixed and we pull in a new version with that fix, we'll probably want to allow users to specify whether or not the downloaded gzip'd file should be decompressed (this is the behavior today, so it should probably be the default), or if the downloaded file should contain the compressed bytes.
changed the title [-]`download_to_file()` decompresses gzip'd object even when "Accept-Encoding: gzip" is passed through to the request[/-][+]Storage: `download_to_file()` decompresses gzip'd object even when passed "Accept-Encoding: gzip"[/+]on Sep 20, 2018
At that point, we will need to surface options to the Blob.download_* methods which enable "raw" streaming: iniially, that option will need to default to False for backward-compatibility.
As of PR #9565 (being released today in google-cloud-storage 1.23.0 release, PR #9778), the Blob.download_* methods take an optional raw_download argument: if True, then the decompression will not happen. Unfortunately, we have to leave it defaulted to False for backward-compatibility.
Activity
[-]`download_to_file()` decompresses gzip'd object even when "Accept-Encoding: gzip" is passed through to the request[/-][+]Storage: `download_to_file()` decompresses gzip'd object even when passed "Accept-Encoding: gzip"[/+]tseaver commentedon Oct 18, 2018
/cc @frankyn
tseaver commentedon Oct 22, 2019
Fix blocked on a non-b0rken release of the "raw downloads" feature for
google-resumable-media(see googleapis/google-resumable-media-python#109).At that point, we will need to surface options to the
Blob.download_*methods which enable "raw" streaming: iniially, that option will need to default toFalsefor backward-compatibility.tseaver commentedon Nov 12, 2019
As of PR #9565 (being released today in
google-cloud-storage 1.23.0release, PR #9778), theBlob.download_*methods take an optionalraw_downloadargument: ifTrue, then the decompression will not happen. Unfortunately, we have to leave it defaulted to False for backward-compatibility.