This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: test.test_ssl.ThreadedTests unit test failed
Type: Stage: resolved
Components: Tests Versions: Python 3.5
Status: closed Resolution: works for me
Dependencies: Superseder:
Assigned To: Nosy List: Roman.Rader, ned.deily
Priority: normal Keywords:

Created on 2015-05-10 11:04 by Roman.Rader, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (4)
msg242854 - (view) Author: Roman Rader (Roman.Rader) Date: 2015-05-10 11:05
FAIL: test_server_accept (test.test_ssl.ThreadedTests)
Traceback (most recent call last):
  File "/home/roma/Documents/MY/cpython/Lib/test/", line 2904, in test_server_accept
    self.assertEqual(peer, client_addr)
AssertionError: Tuples differ: ('', 43446) != ('', 43446)
msg242924 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2015-05-11 22:41
There are places in the test suite that assume is the standard loopback address and will fail if the system under test doesn't follow that convention; see, for example, the discussion in Issue22753.  I suspect that, in your case, the system's host configuration (/etc/hosts, DNS configuration, or similar) is such that the loopback address ( is "round-tripped" as the actual address ( of the interface.  What platform are you running this on?  Can you check what the addresses association with "localhost" and the names associated with the two IP addresses?  For example, on many POSIX-y platforms, the following might work:

dig localhost
dig -x
dig -x
msg242976 - (view) Author: Roman Rader (Roman.Rader) Date: 2015-05-12 14:59
You're right, it does not reproduces on any machine. I'm using Arch Linux, still trying to figure out the repro steps.

My hosts file doesn't contain such entries for localhost, it's pretty standard. If I disable my external network interface, it retrieves my second IP from virtual interface. And only when I disable all interfaces, I can get on source in IP packet.

The problem is, even if I enforce client to bind to "", it substitutes as well (see

strace is clean, Python calls all kernel functions with IP. So, I suppose, the problem not in the Python code itself, but somewhere deeper (however it can be lack of some flags?)
msg243003 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2015-05-12 20:03
Thanks for the additional info.  I don't know what possible configuration options might affect this other than that I would expect to see as the primary IPv4 address on the loopback interface, like:

# ifconfig
lo        Link encap:Local Loopback
          inet addr:  Mask:
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1

Since this does seem to be unique to your configuration, I'm going to close this issue for now.  If you do discover the root cause and it appears to be something that might be seen by other users and, thus, should be handled in the test suite, please re-open.
Date User Action Args
2022-04-11 14:58:16adminsetgithub: 68344
2015-05-12 20:03:59ned.deilysetstatus: open -> closed
resolution: works for me
messages: + msg243003

stage: resolved
2015-05-12 14:59:46Roman.Radersetmessages: + msg242976
2015-05-11 22:41:16ned.deilysetnosy: + ned.deily
messages: + msg242924
2015-05-10 11:05:39Roman.Radersetversions: + Python 3.5
messages: + msg242854
components: + Tests
title: unit test -> test.test_ssl.ThreadedTests unit test failed
2015-05-10 11:04:06Roman.Radercreate