]> granicus.if.org Git - python/commitdiff
When testing for localhost/ first map to lower case. Spotted by Skip.
authorJack Jansen <jack.jansen@cwi.nl>
Thu, 12 Sep 2002 20:14:04 +0000 (20:14 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Thu, 12 Sep 2002 20:14:04 +0000 (20:14 +0000)
Lib/urllib.py

index 7b39ea91b809f6dd4e67f1f89c6d26706a788f96..f098b5d0faaeddcf6f35842333afd6fd7d95f118 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] != '/' 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)