[projects/pld-builder.new] rpm_builder: reap the chroot cat when the src.rpm download breaks
arekm
arekm at pld-linux.org
Mon Oct 26 17:16:31 CET 2026
commit 204eb0ffd38dce9c9c65d9bfff8e59f335a6e89e
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Sat Oct 24 11:59:10 2026 +0200
rpm_builder: reap the chroot cat when the src.rpm download breaks
IncompleteRead is no OSError and slipped past the handler.
PLD_Builder/rpm_builder.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/PLD_Builder/rpm_builder.py b/PLD_Builder/rpm_builder.py
index 628d984..a2797f1 100644
--- a/PLD_Builder/rpm_builder.py
+++ b/PLD_Builder/rpm_builder.py
@@ -2,6 +2,7 @@
import contextlib
+import http.client
import sys
import os
import time
@@ -129,8 +130,9 @@ def fetch_src(r, b):
o.write(chunk)
size += len(chunk)
rc = o.close()
- except IOError as e:
- b.log_line("error: unable to write to `%s': %s" % (b.src_rpm, e))
+ except (IOError, http.client.HTTPException) as e:
+ # either end: a dropped download (IncompleteRead) or a broken pipe
+ b.log_line(f"error: copying {src_url} into `{b.src_rpm}' failed: {e!r}")
with contextlib.suppress(OSError):
o.close()
raise
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/projects/pld-builder.new.git/commitdiff/ce9feb3c796ed049b6dd260a50d94d80feb1656d
More information about the pld-cvs-commit
mailing list