summaryrefslogtreecommitdiff
path: root/Lib/urllib/request.py
diff options
context:
space:
mode:
authorSenthil Kumaran <senthil@uthcode.com>2014-07-22 00:15:20 -0700
committerSenthil Kumaran <senthil@uthcode.com>2014-07-22 00:15:20 -0700
commitbc07ac51801ae261ce09f057cbb4ecf9b7cdc07c (patch)
tree967f2c71f50f19a82f0a87434c0e477dfcc88cd2 /Lib/urllib/request.py
parentdfab935c74745133234dded912ec1b0721888505 (diff)
downloadcpython-git-bc07ac51801ae261ce09f057cbb4ecf9b7cdc07c.tar.gz
Fix localhost checking in FileHandler. Raised in #21970.
Diffstat (limited to 'Lib/urllib/request.py')
-rw-r--r--Lib/urllib/request.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py
index 72e91dd5f4..0389f5e853 100644
--- a/Lib/urllib/request.py
+++ b/Lib/urllib/request.py
@@ -1315,7 +1315,7 @@ class FileHandler(BaseHandler):
url = req.selector
if url[:2] == '//' and url[2:3] != '/' and (req.host and
req.host != 'localhost'):
- if not req.host is self.get_names():
+ if not req.host in self.get_names():
raise URLError("file:// scheme is supported only on localhost")
else:
return self.open_local_file(req)