[issue8576] test_support.find_unused_port can cause socket conflicts on Windows

Paul Moore report at bugs.python.org
Tue May 4 18:03:12 CEST 2010


Paul Moore <p.f.moore at gmail.com> added the comment:

One of the tests in test_socket is checking that an attempt to connect to a port with no server running gives socket.error. For that, we need a port that's guaranteed to have no server present.

I think that one of the tests in test_httplib checks the source_address attribute to make sure the port it contains is the one you connected on - again, you need a specific port and it can't be in use. (Sorry, I'm not precise on the details of this one as it's only in trunk and I'm not at a PC with a trunk checkout at the moment).

Arguably these tests are of limited value and could simply be deleted, but they are there, and I don't see a way of implementing them without using something that gives you an unused port number...

----------

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


More information about the Python-bugs-list mailing list