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

calls to addinfourl() in open_file().
This commit is contained in:
Guido van Rossum 1999-02-22 19:01:42 +00:00
parent ba21d10d9b
commit 4505895e68
1 changed files with 2 additions and 2 deletions

View File

@ -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