Kurt Rose added the comment: Sorry, dumb mistake on my part. I should have been calling getpeername(), not getsockname()
In that case the result is 80: >>> socket.create_connection( ('google.com', 2**16 + 80) ).getpeername() ('74.125.239.41', 80) The "random" ports were the client-side ephemeral ports. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue24169> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com