New submission from Deokhwan Kim <d...@csail.mit.edu>:

There is a minor typo in Lib/urllib/request.py:thishost(). Because of it, the 
thishost() function is returning a garbage value:

  >>> import urllib.request
  >>> urllib.request.thishost()
  ('XXXXXXX.XXXXX.XXX.com', ['X.XXXXX.XXX.com'], ['123.45.67.89'])

It is expected to return the IP addresses of the current host, so the correct 
return value would be like:

  >>> urllib.request.thishost.__doc__
  'Return the IP addresses of the current host.'
  >>> urllib.request.thishost()
  ('127.0.0.1', '127.0.1.1')

The attached patch will fix the mistake .

----------
components: Library (Lib)
files: thishost.patch
keywords: patch
messages: 144929
nosy: dkim
priority: normal
severity: normal
status: open
title: urllib.request.thishost() returns a garbage value
type: behavior
versions: Python 3.2
Added file: http://bugs.python.org/file23316/thishost.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue13104>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to