]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
As Des Barry points out, we need to call pathname2url(file) in two
authorGuido van Rossum <guido@python.org>
Mon, 22 Feb 1999 19:01:42 +0000 (19:01 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 22 Feb 1999 19:01:42 +0000 (19:01 +0000)
calls to addinfourl() in open_file().

Lib/urllib.py

index d37906c0b2ddbd0f387e208ae6cfd03d0c6fdee3..7a7b22c570f8deea240649f6a449e38122aa607f 100644 (file)
@@ -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