When testing for localhost/ first map to lower case. Spotted by Skip.
diff --git a/Lib/urllib.py b/Lib/urllib.py
index 7b39ea9..f098b5d 100644
--- a/Lib/urllib.py
+++ b/Lib/urllib.py
@@ -404,7 +404,7 @@
 
     def open_file(self, url):
         """Use local file or FTP depending on form of URL."""
-        if url[:2] == '//' and url[2:3] != '/' and url[2:12] != 'localhost/':
+        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)