зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1484012: [fetch-content] Transparently decompress artifacts; r=gps
generic-worker transparently compresses uncompressed artifacts. Teach fetch-content to decompress those artifacts. Differential Revision: https://phabricator.services.mozilla.com/D3555 --HG-- extra : rebase_source : 3e1847b545de5443fd4349f75acc605ea5a46701
This commit is contained in:
Родитель
6701e41a4c
Коммит
9fd238c7e3
|
@ -60,6 +60,9 @@ def stream_download(url, sha256=None, size=None):
|
|||
|
||||
t0 = time.time()
|
||||
with urllib.request.urlopen(url) as fh:
|
||||
if not url.endswith('.gz') and fh.info().get('Content-Encoding') == 'gzip':
|
||||
fh = gzip.GzipFile(fileobj=fh)
|
||||
|
||||
while True:
|
||||
chunk = fh.read(65536)
|
||||
if not chunk:
|
||||
|
|
Загрузка…
Ссылка в новой задаче