From c860db13a9e33f8db3d55f06a8df368b2cb44b51 Mon Sep 17 00:00:00 2001 From: John Ralls Date: Sat, 14 Nov 2015 12:19:28 -0800 Subject: [PATCH] Catch urlopen TypeError when context arg isn't supported. Python changed the behavior and args for urllib.urlopen; the context arg is needed to avoid cert checking in 3.4.3 and later, but isn't supported before, where the default is to not check certs. --- gramps/gen/plug/utils.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gramps/gen/plug/utils.py b/gramps/gen/plug/utils.py index 660c052e8..4d5a18456 100644 --- a/gramps/gen/plug/utils.py +++ b/gramps/gen/plug/utils.py @@ -199,6 +199,10 @@ def available_updates(): URL = ("%s/listings/addons-%s.txt" % (config.get("behavior.addons-url"), lang[:2])) fp = urlopen(URL, timeout=10, context=context) + except TypeError: + URL = ("%s/listings/addons-%s.txt" % + (config.get("behavior.addons-url"), lang[:2])) + fp = urlopen(URL, timeout=10) except Exception as err: # some error LOG.warning("Failed to open addon metadata for {lang} {url}: {err}". format(lang=lang, url=URL, err=err))