Kaydet (Commit) 4505895e authored tarafından Guido van Rossum's avatar Guido van Rossum

As Des Barry points out, we need to call pathname2url(file) in two

calls to addinfourl() in open_file().
üst ba21d10d
...@@ -334,13 +334,13 @@ class URLopener: ...@@ -334,13 +334,13 @@ class URLopener:
if not host: if not host:
return addinfourl( return addinfourl(
open(url2pathname(file), 'rb'), open(url2pathname(file), 'rb'),
headers, 'file:'+file) headers, 'file:'+pathname2url(file))
host, port = splitport(host) host, port = splitport(host)
if not port and socket.gethostbyname(host) in ( if not port and socket.gethostbyname(host) in (
localhost(), thishost()): localhost(), thishost()):
return addinfourl( return addinfourl(
open(url2pathname(file), 'rb'), open(url2pathname(file), 'rb'),
headers, 'file:'+file) headers, 'file:'+pathname2url(file))
raise IOError, ('local file error', 'not on local host') raise IOError, ('local file error', 'not on local host')
# Use FTP protocol # 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