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.

classification
Title: build python failed on test_socket due to unused_port is actually used.
Type: Stage: resolved
Components: Build Versions: Python 3.6
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: Shuo Li, vstinner, xiang.zhang
Priority: normal Keywords:

Created on 2017-03-09 03:54 by Shuo Li, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (5)
msg289268 - (view) Author: Shuo Li (Shuo Li) Date: 2017-03-09 03:54
I am running a debian system. And trying to build cpython3.6 from source. 
When I run make altinstall, it failed on test_socket. Reporting cli attribute is missing.

After some trouble shooting, it seems the support.get_unused_port() is not reliable. Then I modified it and return a port I am sure no one is using, the build succeeded.
msg289279 - (view) Author: Xiang Zhang (xiang.zhang) * (Python committer) Date: 2017-03-09 07:31
Could you show the failure message here? And you could make your patch a PR on GitHub.
msg289351 - (view) Author: Shuo Li (Shuo Li) Date: 2017-03-10 10:41
The error message is just a "Port already used".

Possible cause 1: find_port default interface is HOST, which is 127.0.0.1. And in most test cases, they use 0.0.0.0. So they are on different interface. 

2: system reuse the port, since I build python on a busy server, that is possible.
msg289354 - (view) Author: Shuo Li (Shuo Li) Date: 2017-03-10 11:26
Another error message:
Unhandled exception in thread started by <bound method ThreadableTest.clientRun of <test.test_socket.NetworkConnectionAttributesTest testMethod=testSourceAddress>>
Traceback (most recent call last):
  File "/tmp/python3.6/Python-3.6.0/Lib/test/test_socket.py", line 293, in clientRun
    self.clientTearDown()
  File "/tmp/python3.6/Python-3.6.0/Lib/test/test_socket.py", line 4379, in clientTearDown
    self.cli.close()
AttributeError: 'NetworkConnectionAttributesTest' object has no attribute 'cli'
msg301908 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-09-11 21:46
I am sorry but it is not possible to fix the issue since we don't have enough information to identify or reproduce the bug.
History
Date User Action Args
2022-04-11 14:58:44adminsetgithub: 73953
2017-09-11 21:46:47vstinnersetstatus: open -> closed

nosy: + vstinner
messages: + msg301908

resolution: out of date
stage: resolved
2017-03-10 11:26:49Shuo Lisetmessages: + msg289354
2017-03-10 10:41:59Shuo Lisetmessages: + msg289351
2017-03-09 07:31:22xiang.zhangsetnosy: + xiang.zhang
messages: + msg289279
2017-03-09 03:54:20Shuo Licreate