Auto merge of #27761 - servo:report, r=SimonSapin

Layout 2020 regression report: add support for gzip’ed log artifacts

Taskcluster workers started compressing artifacts by default in https://github.com/taskcluster/taskcluster/pull/2809
This commit is contained in:
bors-servo 2020-11-14 07:51:43 -05:00 committed by GitHub
commit 48aa8f5f6e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,6 +4,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
import gzip
import json
import os
import re
@ -20,7 +21,13 @@ def fetch(url):
print("Fetching " + url)
response = urllib.request.urlopen(url)
assert response.getcode() == 200
return response
encoding = response.info().get("Content-Encoding")
if not encoding:
return response
elif encoding == "gzip":
return gzip.GzipFile(fileobj=response)
else:
raise ValueError("Unsupported Content-Encoding: %s" % encoding)
def fetch_json(url):