mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-03-12 15:41:09 +00:00
syncpackage: Catch exceptions cleanly, simply skipping to the next package (erring on the side of caution) if there is an error doing the download (LP: #1943286).
This commit is contained in:
parent
2e550ceff2
commit
ba3f0511f9
3
debian/changelog
vendored
3
debian/changelog
vendored
@ -16,6 +16,9 @@ ubuntu-dev-tools (0.206) UNRELEASED; urgency=medium
|
||||
* syncpackage: s/syncblacklist/syncblocklist/g
|
||||
* syncpackage: Cache the sync blocklist in-memory, so it's not fetched
|
||||
multiple times when syncing more than one package.
|
||||
* syncpackage: Catch exceptions cleanly, simply skipping to the next
|
||||
package (erring on the side of caution) if there is an error doing the
|
||||
download (LP: #1943286).
|
||||
|
||||
-- Simon Quigley <tsimonq2@debian.org> Tue, 04 Mar 2025 13:04:30 -0600
|
||||
|
||||
|
@ -459,8 +459,12 @@ def is_blocklisted(query):
|
||||
global cached_sync_blocklist
|
||||
if not cached_sync_blocklist:
|
||||
url = "https://ubuntu-archive-team.ubuntu.com/sync-blocklist.txt"
|
||||
with urllib.request.urlopen(url) as f:
|
||||
cached_sync_blocklist = f.read().decode("utf-8")
|
||||
try:
|
||||
with urllib.request.urlopen(url) as f:
|
||||
cached_sync_blocklist = f.read().decode("utf-8")
|
||||
except:
|
||||
print("WARNING: unable to download the sync blocklist. Erring on the side of caution.")
|
||||
return ("ALWAYS", "INTERNAL ERROR: Unable to fetch sync blocklist")
|
||||
|
||||
applicable_lines = []
|
||||
for line in cached_sync_blocklist.splitlines():
|
||||
|
Loading…
x
Reference in New Issue
Block a user