From: Guido van Rossum Date: Thu, 10 Oct 1996 16:01:16 +0000 (+0000) Subject: Fix some cases where self.openedurl wasn't set. X-Git-Tag: v1.4~110 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b030bc026eb57861568fdc9310512185c95a6f11;p=thirdparty%2FPython%2Fcpython.git Fix some cases where self.openedurl wasn't set. --- diff --git a/Lib/urllib.py b/Lib/urllib.py index 7b5ed6b35944..418650253b81 100644 --- a/Lib/urllib.py +++ b/Lib/urllib.py @@ -254,12 +254,13 @@ class URLopener: # Use local file def open_local_file(self, url): host, file = splithost(url) - if not host: return addinfourl(open(url2pathname(file), 'r'), noheaders(), self.openedurl) + if not host: + return addinfourl(open(url2pathname(file), 'r'), noheaders(), 'file:'+file) host, port = splitport(host) if not port and socket.gethostbyname(host) in ( localhost(), thishost()): file = unquote(file) - return addinfourl(open(url2pathname(file), 'r'), noheaders(), self.openedurl) + return addinfourl(open(url2pathname(file), 'r'), noheaders(), 'file:'+file) raise IOError, ('local file error', 'not on local host') # Use FTP protocol