From e647964386a79668091a75ad60fd79b95aaae416 Mon Sep 17 00:00:00 2001 From: apt-ghetto Date: Sun, 8 Sep 2019 22:57:47 -0700 Subject: [PATCH] Fix UnboundLocalError in automirror module Summary: When opening an URL, an error may be raised and the wrong, not defined variable was logged. Test Plan: Create an HTTPError or an URLError (socket.timeout), when opening "https://ipapi.co/json" Reviewers: wxl, tsimonq2, kc2bez Reviewed By: wxl, kc2bez Differential Revision: https://phab.lubuntu.me/D42 --- common/modules/automirror/main.py | 4 ++-- debian/changelog | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/common/modules/automirror/main.py b/common/modules/automirror/main.py index 79d058c..573d402 100644 --- a/common/modules/automirror/main.py +++ b/common/modules/automirror/main.py @@ -112,10 +112,10 @@ def getcountrycode(): localedata = json.loads(url.read().decode()) except HTTPError as error: logging.error("Data not retrieved because %s - URL: %s", - error, url) + error, geoipurl) except URLError as error: if isinstance(error.reason, socket.timeout): - logging.error("Socket timed out - URL %s", url) + logging.error("Socket timed out - URL %s", geoipurl) else: logging.error("Non-timeout protocol error.") else: diff --git a/debian/changelog b/debian/changelog index 7677ddf..a481037 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +calamares-settings-ubuntu (1:19.10.5) eoan; urgency=medium + + * Fix UnboundLocalError in automirror module. + + -- apt-ghetto Sun, 08 Sep 2019 11:17:17 +0200 + calamares-settings-ubuntu (1:19.10.4) eoan; urgency=medium [ Dan Simmons ]