From bfa1263b8ec5cc3ca2de0e54184f81db99a13ab1 Mon Sep 17 00:00:00 2001 From: CloudBuilder Date: Wed, 1 Dec 2021 23:18:15 +0000 Subject: [PATCH] Imported 2.664.35 No reason for CPC update specified. --- debian/changelog | 7 +++++++ magic-proxy | 6 ++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 779e89da..7e0552aa 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +livecd-rootfs (2.664.35) focal; urgency=medium + + [ Thomas Bechtold ] + * magic-proxy: fix exception handling for URLError (LP: #1946520) + + -- Brian Murray Thu, 18 Nov 2021 15:42:45 -0800 + livecd-rootfs (2.664.34) focal; urgency=medium * Add the capability to build an ISO image for the Intel IoT project. diff --git a/magic-proxy b/magic-proxy index 10f19c47..af765c32 100755 --- a/magic-proxy +++ b/magic-proxy @@ -883,8 +883,10 @@ class ProxyingHTTPRequestHandler(http.server.BaseHTTPRequestHandler): self.__send_response(e) except urllib.error.URLError as e: self.log_message( - "urlopen() failed for {} with {}".format(uri, e.reason)) - self.send_error(501, e.reason) + "urlopen() failed for {} with {}".format(uri, str(e.reason))) + # URLError.reason can either be a string or another Exception + # So do convert it to a string before sending the error (LP: #1946520) + self.send_error(501, str(e.reason)) def __get_host_path(self):