Skip to content

Commit 38acfae

Browse files
authored
fix(get-modflow): use urlopen for download (#2807)
Followup on #2806
1 parent b8dfaeb commit 38acfae

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

flopy/utils/get_modflow.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,11 @@ def run_main(
464464
else:
465465
if not quiet:
466466
print(f"downloading '{download_url}' to '{download_pth}'")
467-
urllib.request.urlretrieve(download_url, download_pth)
467+
with urlopen(
468+
urllib.request.Request(download_url), timeout=120, quiet=quiet
469+
) as resp:
470+
with open(download_pth, "wb") as f:
471+
shutil.copyfileobj(resp, f)
468472

469473
if subset:
470474
if isinstance(subset, str):

0 commit comments

Comments
 (0)