mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
As Des Barry points out, we need to call pathname2url(file) in two
calls to addinfourl() in open_file().
This commit is contained in:
parent
ba21d10d9b
commit
4505895e68
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue