mirror of
https://github.com/python/cpython.git
synced 2025-07-23 19:25:40 +00:00
Yet another patch by Sjoerd Mullender:
Don't convert URLs to URLs using pathname2url.
This commit is contained in:
parent
f03fdbc063
commit
3764595c98
1 changed files with 2 additions and 2 deletions
|
@ -326,12 +326,12 @@ class URLopener:
|
||||||
host, file = splithost(url)
|
host, file = splithost(url)
|
||||||
if not host:
|
if not host:
|
||||||
return addinfourl(open(url2pathname(file), 'rb'),
|
return addinfourl(open(url2pathname(file), 'rb'),
|
||||||
headers, 'file:'+pathname2url(file))
|
headers, 'file:'+file)
|
||||||
host, port = splitport(host)
|
host, port = splitport(host)
|
||||||
if not port \
|
if not port \
|
||||||
and socket.gethostbyname(host) in (localhost(), thishost()):
|
and socket.gethostbyname(host) in (localhost(), thishost()):
|
||||||
return addinfourl(open(url2pathname(file), 'rb'),
|
return addinfourl(open(url2pathname(file), 'rb'),
|
||||||
headers, 'file:'+pathname2url(file))
|
headers, 'file:'+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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue