diff options
author | Senthil Kumaran <senthil@uthcode.com> | 2014-07-22 07:16:18 (GMT) |
---|---|---|
committer | Senthil Kumaran <senthil@uthcode.com> | 2014-07-22 07:16:18 (GMT) |
commit | 284a4a1bb0496f24e7c0243bbe9fcca7bfa6b2f0 (patch) | |
tree | f7c042c7e40724f2ec97ab4206b4b362c5d75d7a /Lib/test | |
parent | 26408df88fa6d84f0702964cef60e74c7830c066 (diff) | |
parent | bc07ac51801ae261ce09f057cbb4ecf9b7cdc07c (diff) | |
download | cpython-284a4a1bb0496f24e7c0243bbe9fcca7bfa6b2f0.zip cpython-284a4a1bb0496f24e7c0243bbe9fcca7bfa6b2f0.tar.gz cpython-284a4a1bb0496f24e7c0243bbe9fcca7bfa6b2f0.tar.bz2 |
Merge 3.4
Fix localhost checking in FileHandler. Raised in #21970.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_urllib2.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/test/test_urllib2.py b/Lib/test/test_urllib2.py index 6b73723..7620876 100644 --- a/Lib/test/test_urllib2.py +++ b/Lib/test/test_urllib2.py @@ -678,7 +678,7 @@ class HandlerTests(unittest.TestCase): self.assertEqual(int(headers["Content-length"]), len(data)) def test_file(self): - import email.utils, socket + import email.utils h = urllib.request.FileHandler() o = h.parent = MockOpener() @@ -725,6 +725,7 @@ class HandlerTests(unittest.TestCase): for url in [ "file://localhost:80%s" % urlpath, "file:///file_does_not_exist.txt", + "file://not-a-local-host.com//dir/file.txt", "file://%s:80%s/%s" % (socket.gethostbyname('localhost'), os.getcwd(), TESTFN), "file://somerandomhost.ontheinternet.com%s/%s" % |