From 8e9b2fc750a41491b00563a92002f0c2f426a997 Mon Sep 17 00:00:00 2001 From: Mainak Kundu Date: Tue, 19 Aug 2025 12:32:23 -0400 Subject: [PATCH 1/3] fix: Throw underlying UrlError while downloading example files --- src/ansys/fluent/core/utils/networking.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/ansys/fluent/core/utils/networking.py b/src/ansys/fluent/core/utils/networking.py index 92e034628b0b..0e63024c0bea 100644 --- a/src/ansys/fluent/core/utils/networking.py +++ b/src/ansys/fluent/core/utils/networking.py @@ -131,11 +131,8 @@ def check_url_exists(url: str) -> bool: bool True if the URL exists, False otherwise """ - try: - with urllib.request.urlopen(url) as response: - return response.status == 200 - except Exception: - return False + with urllib.request.urlopen(url) as response: + return response.status == 200 def get_url_content(url: str) -> str: From ebcbb86fb2286dcf258fa2f87766483ebcd8752b Mon Sep 17 00:00:00 2001 From: Mainak Kundu Date: Thu, 21 Aug 2025 11:36:59 -0400 Subject: [PATCH 2/3] fix: Throw underlying SSLError while downloading example files --- src/ansys/fluent/core/utils/networking.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/ansys/fluent/core/utils/networking.py b/src/ansys/fluent/core/utils/networking.py index 0e63024c0bea..c5d97e76e30a 100644 --- a/src/ansys/fluent/core/utils/networking.py +++ b/src/ansys/fluent/core/utils/networking.py @@ -25,6 +25,7 @@ from concurrent import futures import logging import socket +import ssl from typing import Any import urllib.request @@ -130,9 +131,20 @@ def check_url_exists(url: str) -> bool: ------- bool True if the URL exists, False otherwise + + Raises + ------ + ssl.SSLError + If there is an SSL error while checking the URL """ - with urllib.request.urlopen(url) as response: - return response.status == 200 + try: + with urllib.request.urlopen(url) as response: + return response.status == 200 + except urllib.error.URLError as ex: + if ex.__context__ and isinstance(ex.__context__, ssl.SSLError): + raise ex.__context__ + else: + return False def get_url_content(url: str) -> str: From 322455eb8dc82459c0a5673e7c16b51d86cd2dd3 Mon Sep 17 00:00:00 2001 From: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com> Date: Thu, 21 Aug 2025 15:38:01 +0000 Subject: [PATCH 3/3] chore: adding changelog file 4396.fixed.md [dependabot-skip] --- doc/changelog.d/4396.fixed.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 doc/changelog.d/4396.fixed.md diff --git a/doc/changelog.d/4396.fixed.md b/doc/changelog.d/4396.fixed.md new file mode 100644 index 000000000000..aadac0aaf8f2 --- /dev/null +++ b/doc/changelog.d/4396.fixed.md @@ -0,0 +1 @@ +Raise the underlying urlerror while downloading example file