From: Guido van Rossum Date: Mon, 22 Feb 1999 19:01:42 +0000 (+0000) Subject: As Des Barry points out, we need to call pathname2url(file) in two X-Git-Tag: v1.5.2c1~279 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4505895e68b1866de819566b87de44543993d5cf;p=thirdparty%2FPython%2Fcpython.git As Des Barry points out, we need to call pathname2url(file) in two calls to addinfourl() in open_file(). --- diff --git a/Lib/urllib.py b/Lib/urllib.py index d37906c0b2dd..7a7b22c570f8 100644 --- a/Lib/urllib.py +++ b/Lib/urllib.py @@ -334,13 +334,13 @@ class URLopener: if not host: return addinfourl( open(url2pathname(file), 'rb'), - headers, 'file:'+file) + headers, 'file:'+pathname2url(file)) host, port = splitport(host) if not port and socket.gethostbyname(host) in ( localhost(), thishost()): return addinfourl( open(url2pathname(file), 'rb'), - headers, 'file:'+file) + headers, 'file:'+pathname2url(file)) raise IOError, ('local file error', 'not on local host') # Use FTP protocol