diff --git a/linkcheck/HttpUrlData.py b/linkcheck/HttpUrlData.py index ead06bba..65c81074 100644 --- a/linkcheck/HttpUrlData.py +++ b/linkcheck/HttpUrlData.py @@ -15,7 +15,8 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -import urlparse, urllib, sys, time, re, httplib +import urlparse, sys, time, re, httplib +from urllib import unquote import Config, StringUtil, i18n from linkcheck import robotparser from debug import * @@ -124,7 +125,7 @@ class HttpUrlData (ProxyUrlData): newurl = self.headers.getheader("Location", self.headers.getheader("Uri", "")) redirected = urlparse.urljoin(redirected, newurl) - redirected = urllib.unquote(redirected) + redirected = unquote(redirected) self.urlparts = urlparse.urlsplit(redirected) response = self._getHttpResponse() self.headers = response.msg diff --git a/linkcheck/UrlData.py b/linkcheck/UrlData.py index 1ba48d54..5da6d438 100644 --- a/linkcheck/UrlData.py +++ b/linkcheck/UrlData.py @@ -16,7 +16,7 @@ # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. import sys, re, urlparse, urllib, time, traceback, socket, select, i18n -from urllib import splituser, splithost, splitport +from urllib import splituser, splithost, splitport, unquote #try: # from linkcheck import DNS #except ImportError: @@ -175,7 +175,7 @@ class UrlData: else: self.url = self.urlName # unquote url - self.url = urllib.unquote(self.url) + self.url = unquote(self.url) # split into (modifiable) list self.urlparts = list(urlparse.urlsplit(self.url)) # check userinfo@host:port syntax