Commit 3764595c authored by Guido van Rossum's avatar Guido van Rossum

Yet another patch by Sjoerd Mullender:

Don't convert URLs to URLs using pathname2url.
parent f03fdbc0
......@@ -326,12 +326,12 @@ class URLopener:
host, file = splithost(url)
if not host:
return addinfourl(open(url2pathname(file), 'rb'),
headers, 'file:'+pathname2url(file))
headers, 'file:'+file)
host, port = splitport(host)
if not port \
and socket.gethostbyname(host) in (localhost(), thishost()):
return addinfourl(open(url2pathname(file), 'rb'),
headers, 'file:'+pathname2url(file))
headers, 'file:'+file)
raise IOError, ('local file error', 'not on local host')
# Use FTP protocol
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment