]> granicus.if.org Git - python/commitdiff
Treat file://localhost/ as local too (same as file:/ and file:///).
authorJack Jansen <jack.jansen@cwi.nl>
Thu, 12 Sep 2002 19:47:52 +0000 (19:47 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Thu, 12 Sep 2002 19:47:52 +0000 (19:47 +0000)
Fixes #607789, bugfix candidate.

Lib/urllib.py

index 758ab925ca2b6c74811f1fb908f449076a3f11b7..7b39ea91b809f6dd4e67f1f89c6d26706a788f96 100644 (file)
@@ -404,7 +404,7 @@ class URLopener:
 
     def open_file(self, url):
         """Use local file or FTP depending on form of URL."""
-        if url[:2] == '//' and url[2:3] != '/':
+        if url[:2] == '//' and url[2:3] != '/' and url[2:12] != 'localhost/':
             return self.open_ftp(url)
         else:
             return self.open_local_file(url)