From 65665bab99ec15c21efed702a8452e40e005dc07 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Sun, 15 Apr 2007 04:56:34 +0000 Subject: r12375@catbus: nickm | 2007-04-15 00:56:27 -0400 Catch badly-formatted URLs when downloading, not just URLS that fail when downloading. svn:r210 --- updateCache.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/updateCache.py b/updateCache.py index ad62419..f25ff17 100755 --- a/updateCache.py +++ b/updateCache.py @@ -16,6 +16,7 @@ import urllib2 import getopt import socket import errno +import httplib os.umask(022) @@ -55,6 +56,8 @@ def downloadFile(key, ftype, section, url,timeout=None): try: try: infile = urllib2.urlopen(url) + except httplib.InvalidURL, e: + raise UIError("Invalid URL %s: %s"%(url,e)) except IOError, e: raise UIError("Cannot connect to url %s: %s"%(url,e)) except socket.error, e: -- cgit v1.2.3-70-g09d2