[issue18308] checkRecvmsgAddress wrong in test_socket.py (AIX failures)

Charles-François Natali report at bugs.python.org
Sat Jul 6 12:24:24 CEST 2013


Charles-François Natali added the comment:

> I think the safest solution is not to compare scope_id when comparing
> addresses.

Agreed.

However, it might be simpler to special-case the IPv6 addresses
comparison by overriding it in the IPv6 sendmsg base test.

Could you try the patch attached?

----------
Added file: http://bugs.python.org/file30797/test_socket_scope_id.diff

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue18308>
_______________________________________
-------------- next part --------------
diff -r 6a0437adafbd Lib/test/test_socket.py
--- a/Lib/test/test_socket.py	Fri Jun 28 19:25:45 2013 +0200
+++ b/Lib/test/test_socket.py	Sat Jul 06 12:18:10 2013 +0200
@@ -3312,7 +3312,11 @@
 class SendrecvmsgUDP6TestBase(SendrecvmsgDgramFlagsBase,
                               SendrecvmsgConnectionlessBase,
                               ThreadedSocketTestMixin, UDP6TestBase):
-    pass
+
+    def checkRecvmsgAddress(self, addr1, addr2):
+        # Called to compare the received address with the address of
+        # the peer, ignoring scope ID
+        self.assertEqual(addr1[:-1], addr2[:-1])
 
 @requireAttrs(socket.socket, "sendmsg")
 @unittest.skipUnless(support.IPV6_ENABLED, 'IPv6 required for this test.')


More information about the Python-bugs-list mailing list