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_asyncio emits ResourceWarning warnings
Type: Stage: resolved
Components: asyncio Versions: Python 3.8, Python 3.7
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: asvetlov, vstinner, yselivanov
Priority: normal Keywords: patch

Created on 2018-06-06 22:44 by vstinner, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 7460 merged vstinner, 2018-06-06 22:58
PR 7461 merged vstinner, 2018-06-06 23:03
PR 7478 merged vstinner, 2018-06-07 14:03
Messages (4)
msg318864 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-06-06 22:44
vstinner@apu$ ./python -X dev -u -m test test_asyncio -v 2>&1
test_create_connection_ssl_failed_certificate (test.test_asyncio.test_sslproto.SelectorStartTLSTests) ...

Exception in thread test-server:
Traceback (most recent call last):
  File "/home/vstinner/prog/python/master/Lib/test/test_asyncio/", line 263, in _run
  File "/home/vstinner/prog/python/master/Lib/test/test_asyncio/", line 272, in _handle_client
  File "/home/vstinner/prog/python/master/Lib/test/test_asyncio/", line 604, in server
  File "/home/vstinner/prog/python/master/Lib/test/test_asyncio/", line 153, in start_tls
  File "/home/vstinner/prog/python/master/Lib/", line 1108, in do_handshake
OSError: [Errno 0] Error

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/vstinner/prog/python/master/Lib/", line 917, in _bootstrap_inner
  File "/home/vstinner/prog/python/master/Lib/test/test_asyncio/", line 232, in run
  File "/home/vstinner/prog/python/master/Lib/test/test_asyncio/", line 269, in _run
  File "/home/vstinner/prog/python/master/Lib/test/test_asyncio/", line 122, in _abort_socket_test
  File "/home/vstinner/prog/python/master/Lib/unittest/", line 680, in fail
    raise self.failureException(msg)
AssertionError: [Errno 0] Error

/home/vstinner/prog/python/master/Lib/ ResourceWarning: unclosed <ssl.SSLSocket fd=12, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('', 53417), raddr=('', 44022)>
  del exc_type, exc_value, exc_tb


test_start_tls_client_corrupted_ssl (test.test_asyncio.test_sslproto.SelectorStartTLSTests) ...

/home/vstinner/prog/python/master/Lib/test/test_asyncio/ ResourceWarning: unclosed <socket.socket fd=13, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('', 46551), raddr=('', 34620)>
/home/vstinner/prog/python/master/Lib/asyncio/ ResourceWarning: unclosed transport <asyncio.sslproto._SSLProtocolTransport object at 0x7f74c1ac6400>


I'm working on a fix.
msg318865 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-06-06 23:12
New changeset 0eba7c39132614a5730cda6b340e18dfb2d30d14 by Victor Stinner in branch 'master':
bpo-33789: test_asyncio: Fix ResourceWarning (GH-7460)
msg318866 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-06-06 23:13
New changeset 7ed61e9431ee2c191aeeeb26f86a71bb90ab99fd by Victor Stinner in branch 'master':
bpo-33789, test_asyncio: Hide PendingDeprecationWarning (GH-7461)
msg318936 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-06-07 14:19
New changeset 3c417610ad318afecf471d59c53e5ae592740791 by Victor Stinner in branch '3.7':
[3.7] bpo-33789: Backport test_asyncio fixes from master (GH-7478)
Date User Action Args
2022-04-11 14:59:01adminsetgithub: 77970
2018-06-07 14:20:46vstinnersetstatus: open -> closed
stage: patch review -> resolved
resolution: fixed
versions: + Python 3.7
2018-06-07 14:19:03vstinnersetmessages: + msg318936
2018-06-07 14:03:56vstinnersetpull_requests: + pull_request7101
2018-06-07 13:49:26vstinnerlinkissue33743 superseder
2018-06-06 23:13:50vstinnersetmessages: + msg318866
2018-06-06 23:12:41vstinnersetmessages: + msg318865
2018-06-06 23:03:42vstinnersetpull_requests: + pull_request7084
2018-06-06 22:58:05vstinnersetkeywords: + patch
stage: patch review
pull_requests: + pull_request7083
2018-06-06 22:44:08vstinnercreate