[New-bugs-announce] [issue16666] docs wrongly imply socket.getaddrinfo takes keyword arguments in 2.x

Mikel Ward report at bugs.python.org
Wed Dec 12 00:00:09 CET 2012


New submission from Mikel Ward:

The docs for 2.6 and 2.7 say socket.getaddrinfo takes keyword arguments.

http://docs.python.org/release/2.6.6/library/socket.html?highlight=socket#socket.getaddrinfo

> socket.getaddrinfo(host, port, family=0, socktype=0, proto=0, flags=0)

But that doesn't actually work in Python 2.7.

$ ./python 
Python 2.7.3+ (2.7:ec4ea40be2f6, Dec 11 2012, 14:43:35) 
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.

>>> import socket
>>> s = socket.getaddrinfo('localhost', 999, family=socket.AF_INET)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: getaddrinfo() takes no keyword arguments

Looks like it was introduced in 61999:c963478b9092.

----------
assignee: docs at python
components: Documentation
messages: 177356
nosy: Mikel.Ward, docs at python
priority: normal
severity: normal
status: open
title: docs wrongly imply socket.getaddrinfo takes keyword arguments in 2.x
versions: Python 2.6, Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue16666>
_______________________________________


More information about the New-bugs-announce mailing list