From b2015f85f9a56347c25c3e5d7b5d5d3f7f6645dc Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Thu, 16 Nov 2023 20:39:44 +0100 Subject: [PATCH] gdaltest.gdalurlopen(): better detect timeout --- autotest/pymod/gdaltest.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/autotest/pymod/gdaltest.py b/autotest/pymod/gdaltest.py index 1b4458dd5c6d..0df2d87773f1 100755 --- a/autotest/pymod/gdaltest.py +++ b/autotest/pymod/gdaltest.py @@ -1906,6 +1906,10 @@ def gdalurlopen(url, timeout=10): print(f"HTTP service for {url} is down (URL Error: {e.reason})") socket.setdefaulttimeout(old_timeout) return None + except socket.timeout: + print(f"HTTP service for {url} timed out") + socket.setdefaulttimeout(old_timeout) + return None def runexternal(