diff options
Diffstat (limited to 'Lib/urllib')
-rw-r--r-- | Lib/urllib/request.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py index e59208f..cb80a36 100644 --- a/Lib/urllib/request.py +++ b/Lib/urllib/request.py @@ -1188,7 +1188,8 @@ class FileHandler(BaseHandler): # Use local file or FTP depending on form of URL def file_open(self, req): url = req.selector - if url[:2] == '//' and url[2:3] != '/': + if url[:2] == '//' and url[2:3] != '/' and (req.host and + req.host != 'localhost'): req.type = 'ftp' return self.parent.open(req) else: |