fix: retry incomplete windows definition downloads

This commit is contained in:
Carlos Polop
2026-04-30 10:38:31 +02:00
parent eb2c3fbfd1
commit d142e0f1f8
+2 -1
View File
@@ -3,6 +3,7 @@
from __future__ import annotations
import argparse
import http.client
import json
import logging
import os
@@ -159,7 +160,7 @@ def download_bytes(url: str, *, timeout: int, retries: int, accept: str | None =
if not payload:
raise ValueError(f"Received an empty response from {url}")
return payload
except (HTTPError, URLError, TimeoutError, ValueError) as exc:
except (HTTPError, URLError, TimeoutError, ValueError, http.client.IncompleteRead) as exc:
if attempt == retries:
raise RuntimeError(f"Failed to download {url}: {exc}") from exc
logging.warning(