[docs] [issue26437] asyncio create_server() not always accepts the 'port' parameter as str

Guido van Rossum report at bugs.python.org
Thu Feb 25 13:42:38 EST 2016

Guido van Rossum added the comment:

I don't know why it used to accept a string port, but I can't find anything in the docs indicating that is acceptable. I am guessing the doc authors assumed it was so obvious that a port is an integer they forgot to mention it.

I can guess that in the past some system API was used that considered the port a "servname" to be looked up in /etc/services (likely the getaddrinfo() call).

But if you were passing '12345' instead of 12345, well, you always had a latent bug in your program.

I don't think the code ought to be adjusted to explicitly reject string ports; but I do think the docs should be clarified on the issue.

assignee:  -> docs at python
components: +Documentation -Library (Lib)
nosy: +docs at python

Python tracker <report at bugs.python.org>

More information about the docs mailing list