commit 53b7c1c9d3f58a4b0f2264ffca33a34a2692a2a7
parent dbc4ffa612e6d7cf287fb9c5d692dae47568de58
Author: James Graham <james@hoppipolla.co.uk>
Date: Wed, 19 Nov 2025 04:56:14 +0000
Bug 2000684 [wpt PR 56065] - Handle content-encoding: gzip for Android tooling downloads, a=testonly
Automatic update from web-platform-tests
Handle content-encoding: gzip for Android tooling downloads
The Android tooling recently started to double-compress some
artifacts, with a zip file inside a gzip network stream.
Out use of Response.raw didn't handle this, but using
Response.iter_content will. The chunk length seems to be the same as
urllib3 uses internally by default.
--
wpt-commits: cabc4dbc1d46fa318c3465c9464af10cc7de2c15
wpt-pr: 56065
Diffstat:
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/testing/web-platform/tests/tools/wpt/android.py b/testing/web-platform/tests/tools/wpt/android.py
@@ -141,8 +141,10 @@ def download_and_extract(url, path):
try:
with open(temp_path, "wb") as f:
with requests.get(url, stream=True) as resp:
- shutil.copyfileobj(resp.raw, f)
-
+ for chunk in resp.iter_content(2**16):
+ f.write(chunk)
+ if not os.path.exists(temp_path):
+ raise ValueError(f"Failed to download {url}, output path doesn't exist")
# Python's zipfile module doesn't seem to work here
subprocess.check_call(["unzip", temp_path], cwd=path)
finally: