From 6b63168d9831e36a4c5faa1f7cdc6f3b18ab2554 Mon Sep 17 00:00:00 2001 From: wpbonelli Date: Wed, 12 Aug 2026 11:38:30 -0700 Subject: [PATCH] fix(get-modflow): use urlopen for download --- flopy/utils/get_modflow.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/flopy/utils/get_modflow.py b/flopy/utils/get_modflow.py index a26da6de6..73e791edf 100755 --- a/flopy/utils/get_modflow.py +++ b/flopy/utils/get_modflow.py @@ -464,7 +464,11 @@ def run_main( else: if not quiet: print(f"downloading '{download_url}' to '{download_pth}'") - urllib.request.urlretrieve(download_url, download_pth) + with urlopen( + urllib.request.Request(download_url), timeout=120, quiet=quiet + ) as resp: + with open(download_pth, "wb") as f: + shutil.copyfileobj(resp, f) if subset: if isinstance(subset, str):