[issue26858] android: setting SO_REUSEPORT fails

STINNER Victor report at bugs.python.org
Fri Jan 13 10:20:55 EST 2017


STINNER Victor added the comment:

> The reason why the changes made by issue 28174 fix only partly the problem should be understood.

The change c1c247cf3488 catchs OSError on sock.setsockopt() in asyncio/base_events.py, whereas the test fails while calling sock.getsockopt() in test_asyncio/tets_events.py. Extract of the test:

    def test_create_server_reuse_port(self):
        proto = MyProto(self.loop)
        f = self.loop.create_server(
            lambda: proto, '0.0.0.0', 0)
        server = self.loop.run_until_complete(f)
        self.assertEqual(len(server.sockets), 1)
        sock = server.sockets[0]
        self.assertFalse(
            sock.getsockopt(
                socket.SOL_SOCKET, socket.SO_REUSEPORT))
        server.close()

The change c1c247cf3488 doesn't touch the code of this unit test.

test_base_events.py also calls directly sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT).

----------

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


More information about the Python-bugs-list mailing list