Thanks Josiah and Neal, you were right. I am running the code on Windows, Server 2003. I should have mentioned that at the start.
When I change the hostname from "" to "localhost", the code works exactly as expected. It's odd that this behaviour exists, only on Windows. The jython code that I'm writing worked fine with an empty hostname "". That jython code uses the java.net and java.nio APIs directly, and does not have any special cases for empty hostname. Which must mean that the underlying java implementations must be correctly handling the empty hostname, even when running on Windows. (Perhaps by special casing for the Windows implementation, if indeed a peculiarity of the Windows socket libraries is the cause). Which implies to me that cpython, like java, should not have different behaviour on Windows vs. other platforms; it lessens portability. Lack of portability is confirmed by Neal's report that the original unmodified snippet (i.e. with hostname == "") works correctly under cpython on Linux. Thanks guys, Alan. On 3/20/07, Josiah Carlson <[EMAIL PROTECTED]> wrote: > [snip] > > SERVER_ADDRESS = ("", 54321) > > Replacing the above with: > > SERVER_ADDRESS = ("localhost", 54321) > > ...makes it work for me on Windows CPython 2.3.5 and 2.5 . > > - Josiah > > _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com