[projects/pld-builder.new] rpm_builder: fix connection retry in check_skip_build

arekm arekm at pld-linux.org
Wed Aug 12 11:46:31 CEST 2026


commit bb8e4b5adc13d69d679346c4ab9b5895bbb9557b
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Wed Aug 12 11:02:37 2026 +0200

    rpm_builder: fix connection retry in check_skip_build
    
    On python 3 URLError.errno is always None (the errno sits on the wrapped
    exception), so transient network errors returned False instead of retrying.

 PLD_Builder/rpm_builder.py | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)
---
diff --git a/PLD_Builder/rpm_builder.py b/PLD_Builder/rpm_builder.py
index 19eb04c..16fd609 100644
--- a/PLD_Builder/rpm_builder.py
+++ b/PLD_Builder/rpm_builder.py
@@ -64,16 +64,13 @@ def check_skip_build(r, b):
             req = urllib.request.Request(url=src_url, headers=headers)
             f = urllib.request.urlopen(req)
             good = True
-        except urllib.error.HTTPError as error:
+        except urllib.error.HTTPError:
             return False
         except urllib.error.URLError as error:
+            # URLError.errno is always None; the real errno is on the wrapped
+            # exception in error.reason
+            errno = getattr(error.reason, 'errno', None)
             # see errno.h
-            try:
-                errno = error.errno
-            except AttributeError:
-                # python 2.4
-                errno = error.reason[0]
-
             if errno in [-3, 60, 61, 110, 111]:
                 b.log_line("unable to connect... trying again")
                 continue
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/projects/pld-builder.new.git/commitdiff/44916a7a9112928736ec2b65b4fa58a90bc5828c



More information about the pld-cvs-commit mailing list