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: ResourceWarning in test_ssl
Type: behavior Stage: resolved
Components: Tests Versions: Python 3.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: christian.heimes, python-dev, xiang.zhang
Priority: normal Keywords: patch

Created on 2016-09-12 03:34 by xiang.zhang, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issue28093.patch xiang.zhang, 2016-09-12 06:32 review
Messages (4)
msg275940 - (view) Author: Xiang Zhang (xiang.zhang) * (Python committer) Date: 2016-09-12 03:34
I can consistently product a ResourceWarning when running test_ssl:

./python -m test test_ssl
Run tests sequentially
0:00:00 [1/1] test_ssl
Exception in thread Thread-81:
Traceback (most recent call last):
  File "/home/angwer/cpython/Lib/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/home/angwer/cpython/Lib/test/test_ssl.py", line 1924, in run
    if not self.wrap_conn():
  File "/home/angwer/cpython/Lib/test/test_ssl.py", line 1869, in wrap_conn
    self.sock, server_side=True)
  File "/home/angwer/cpython/Lib/ssl.py", line 401, in wrap_socket
    _context=self, _session=session)
  File "/home/angwer/cpython/Lib/ssl.py", line 764, in __init__
    raise ValueError("check_hostname requires server_hostname")
ValueError: check_hostname requires server_hostname

/home/angwer/cpython/Lib/threading.py:916: ResourceWarning: unclosed <socket.socket fd=5, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 34271), raddr=('127.0.0.1', 34156)>
  self.run()
1 test OK.

Total duration: 1 sec
Tests result: SUCCESS
msg275975 - (view) Author: Xiang Zhang (xiang.zhang) * (Python committer) Date: 2016-09-12 06:32
The problem lies in test_echo, using PROTOCOL_TLS_CLIENT as the server but doesn't not provide a hostname? I make a try which seems solving the problem but not sure this is what you want.
msg276003 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-09-12 08:49
New changeset cf2689e191f8 by Christian Heimes in branch 'default':
Issue #28093: Check more invalid combinations of PROTOCOL_TLS_CLIENT / PROTOCOL_TLS_SERVER
https://hg.python.org/cpython/rev/cf2689e191f8
msg276009 - (view) Author: Xiang Zhang (xiang.zhang) * (Python committer) Date: 2016-09-12 09:21
The warning is gone. Close this thread. :)
History
Date User Action Args
2022-04-11 14:58:36adminsetgithub: 72280
2016-09-12 09:21:46xiang.zhangsetstatus: open -> closed
resolution: fixed
messages: + msg276009

stage: patch review -> resolved
2016-09-12 08:49:05python-devsetnosy: + python-dev
messages: + msg276003
2016-09-12 06:32:43xiang.zhangsetfiles: + issue28093.patch
keywords: + patch
messages: + msg275975

stage: patch review
2016-09-12 03:34:02xiang.zhangcreate