diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2013-08-21 22:39:46 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2013-08-21 22:39:46 (GMT) |
commit | f6fbf5607155b2dcd517059c8067305c4d015b00 (patch) | |
tree | 49d363b0218c7c9d8c36a64f029ca45ed49cf905 /Lib/test/test_ftplib.py | |
parent | 13423c3726ac4aa42125ac49e6c5038a015fe3eb (diff) | |
download | cpython-f6fbf5607155b2dcd517059c8067305c4d015b00.zip cpython-f6fbf5607155b2dcd517059c8067305c4d015b00.tar.gz cpython-f6fbf5607155b2dcd517059c8067305c4d015b00.tar.bz2 |
Issue #18792: Use "127.0.0.1" or "::1" instead of "localhost" as much as possible, since "localhost" goes through a DNS lookup under recent Windows versions.
Diffstat (limited to 'Lib/test/test_ftplib.py')
-rw-r--r-- | Lib/test/test_ftplib.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/test/test_ftplib.py b/Lib/test/test_ftplib.py index 25e34be..08d99d8 100644 --- a/Lib/test/test_ftplib.py +++ b/Lib/test/test_ftplib.py @@ -18,7 +18,7 @@ except ImportError: from unittest import TestCase from test import support -from test.support import HOST +from test.support import HOST, HOSTv6 threading = support.import_module('threading') TIMEOUT = 3 @@ -767,7 +767,7 @@ class TestFTPClass(TestCase): class TestIPv6Environment(TestCase): def setUp(self): - self.server = DummyFTPServer(('::1', 0), af=socket.AF_INET6) + self.server = DummyFTPServer((HOSTv6, 0), af=socket.AF_INET6) self.server.start() self.client = ftplib.FTP(timeout=TIMEOUT) self.client.connect(self.server.host, self.server.port) @@ -950,7 +950,7 @@ class TestTimeouts(TestCase): self.assertTrue(socket.getdefaulttimeout() is None) socket.setdefaulttimeout(30) try: - ftp = ftplib.FTP("localhost") + ftp = ftplib.FTP(HOST) finally: socket.setdefaulttimeout(None) self.assertEqual(ftp.sock.gettimeout(), 30) @@ -962,7 +962,7 @@ class TestTimeouts(TestCase): self.assertTrue(socket.getdefaulttimeout() is None) socket.setdefaulttimeout(30) try: - ftp = ftplib.FTP("localhost", timeout=None) + ftp = ftplib.FTP(HOST, timeout=None) finally: socket.setdefaulttimeout(None) self.assertTrue(ftp.sock.gettimeout() is None) |