facebook/tornado — pull request #777 by mauriciosl (2013-05-07 21:11:43+00:00)
Title: bind_unused_port raising gaierror: [Errno 8]

bind_unused_port was passing 0 as port number to the socket module.
This generated some exceptional behaviour on systems where nslookup of
localhost didn't returned the loopback interface.

This commit changes it to pass None instead, this will pass NULL to the underlying C API[1].

[1] http://docs.python.org/2.7/library/socket.html#socket.getaddrinfo