From 4e240b94e142b3f18b770f3fee5cfa3459a7eac0 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 22 Sep 2025 12:30:53 +0530 Subject: [PATCH] explicitly close opened url --- .github/workflows/ci.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.py b/.github/workflows/ci.py index af1bf1985..d4b01e727 100644 --- a/.github/workflows/ci.py +++ b/.github/workflows/ci.py @@ -68,7 +68,8 @@ def download_with_retry(url: str | Request, count: int = 5) -> bytes: for i in range(count): try: print('Downloading', url, flush=True) - ans: bytes = urlopen(url).read() + with urlopen(url) as f: + ans: bytes = f.read() return ans except Exception as err: if i >= count - 1: