Santoso Wijaya added the comment:

Attaching patch to trim leading and trailing whitespaces prior to processing.

Incidentally, this also means:

>>> socket.gethostbyname('')
'0.0.0.0'
>>> socket.gethostbyname(' ')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
socket.gaierror: [Errno -5] No address associated with hostname


But I'm not sure if we're okay with changing that semantics, so I left it be in 
this patch.

----------
keywords: +patch
Added file: http://bugs.python.org/file27537/gethostbyname_whitespace.patch

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

Reply via email to