summaryrefslogtreecommitdiffstats
path: root/Lib/urllib.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1999-02-22 19:01:42 (GMT)
committerGuido van Rossum <guido@python.org>1999-02-22 19:01:42 (GMT)
commit4505895e68b1866de819566b87de44543993d5cf (patch)
tree5581b151965f451114d81e5b1e088f4e37d7b1c9 /Lib/urllib.py
parentba21d10d9b3e3fdddb9ae9507bb836bf7727322d (diff)
downloadcpython-4505895e68b1866de819566b87de44543993d5cf.zip
cpython-4505895e68b1866de819566b87de44543993d5cf.tar.gz
cpython-4505895e68b1866de819566b87de44543993d5cf.tar.bz2
As Des Barry points out, we need to call pathname2url(file) in two
calls to addinfourl() in open_file().
Diffstat (limited to 'Lib/urllib.py')
-rw-r--r--Lib/urllib.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/urllib.py b/Lib/urllib.py
index d37906c..7a7b22c 100644
--- a/Lib/urllib.py
+++ b/Lib/urllib.py
@@ -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