From: Jack Jansen Date: Thu, 12 Sep 2002 19:47:52 +0000 (+0000) Subject: Treat file://localhost/ as local too (same as file:/ and file:///). X-Git-Tag: v2.3c1~4106 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3ae2dc5e5ea7521426ce3f34afa18147435ede5c;p=python Treat file://localhost/ as local too (same as file:/ and file:///). Fixes #607789, bugfix candidate. --- diff --git a/Lib/urllib.py b/Lib/urllib.py index 758ab925ca..7b39ea91b8 100644 --- a/Lib/urllib.py +++ b/Lib/urllib.py @@ -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)