+    try:
+        with urlopen(req) as response:
+            result = json.loads(response.read().decode("utf-8"))
+    except HTTPError as e:

Could add a timeout to avoid hanging if the server is unresponsive. (There's 
also another place that uses urlopen.)

Reply via email to