diff options
| author | Senthil Kumaran <orsenthil@gmail.com> | 2009-12-27 09:16:30 (GMT) | 
|---|---|---|
| committer | Senthil Kumaran <orsenthil@gmail.com> | 2009-12-27 09:16:30 (GMT) | 
| commit | c4151effad5ec16f54730da2d7c1312b97ccada5 (patch) | |
| tree | afb5822ffffdaacb225d6f85a78ba12a0dce5687 /Lib/urllib2.py | |
| parent | d7729339ccb91ebb82005d31848b03ea1e5a42e1 (diff) | |
| download | cpython-c4151effad5ec16f54730da2d7c1312b97ccada5.zip cpython-c4151effad5ec16f54730da2d7c1312b97ccada5.tar.gz cpython-c4151effad5ec16f54730da2d7c1312b97ccada5.tar.bz2 | |
Merged revisions 77058 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
  r77058 | senthil.kumaran | 2009-12-27 14:41:09 +0530 (Sun, 27 Dec 2009) | 4 lines
  Fix for issue5625 - test_urllib2 fails - urlopen error file not on local host.
  This is on hosts with multiple ip addresses.
........
Diffstat (limited to 'Lib/urllib2.py')
| -rw-r--r-- | Lib/urllib2.py | 5 | 
1 files changed, 3 insertions, 2 deletions
| diff --git a/Lib/urllib2.py b/Lib/urllib2.py index a976533..b7f2cf4 100644 --- a/Lib/urllib2.py +++ b/Lib/urllib2.py @@ -1261,8 +1261,9 @@ class FileHandler(BaseHandler):      def get_names(self):          if FileHandler.names is None:              try: -                FileHandler.names = (socket.gethostbyname('localhost'), -                                    socket.gethostbyname(socket.gethostname())) +                FileHandler.names = tuple( +                    socket.gethostbyname_ex('localhost')[2] + +                    socket.gethostbyname_ex(socket.gethostname())[2])              except socket.gaierror:                  FileHandler.names = (socket.gethostbyname('localhost'),)          return FileHandler.names | 
