mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
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:
parent
2db7abad2b
commit
019f8807f1
1 changed files with 8 additions and 1 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue