From 5c6ab4a2dd183b5c1d7b1b14010ccaec560dff8b Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Sun, 6 Oct 2002 03:24:29 +0000 Subject: Backport 1.151 and 1.152: Treat file://localhost/ as local too (same as file:/ and file:///). Fixes #607789, bugfix candidate. --- Lib/urllib.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/urllib.py b/Lib/urllib.py index d30fbb9..5d23a3c 100644 --- a/Lib/urllib.py +++ b/Lib/urllib.py @@ -399,7 +399,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].lower() != 'localhost/': return self.open_ftp(url) else: return self.open_local_file(url) -- cgit v0.12