[New-bugs-announce] [issue33789] test_asyncio emits ResourceWarning warnings

STINNER Victor report at bugs.python.org
Wed Jun 6 18:44:08 EDT 2018


New submission from STINNER Victor <vstinner at redhat.com>:

vstinner at 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/functional.py", line 263, in _run
    self._handle_client(conn)
  File "/home/vstinner/prog/python/master/Lib/test/test_asyncio/functional.py", line 272, in _handle_client
    self._prog(TestSocketWrapper(sock))
  File "/home/vstinner/prog/python/master/Lib/test/test_asyncio/test_sslproto.py", line 604, in server
    server_side=True)
  File "/home/vstinner/prog/python/master/Lib/test/test_asyncio/functional.py", line 153, in start_tls
    ssl_sock.do_handshake()
  File "/home/vstinner/prog/python/master/Lib/ssl.py", line 1108, in do_handshake
    self._sslobj.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/threading.py", line 917, in _bootstrap_inner
    self.run()
  File "/home/vstinner/prog/python/master/Lib/test/test_asyncio/functional.py", line 232, in run
    self._run()
  File "/home/vstinner/prog/python/master/Lib/test/test_asyncio/functional.py", line 269, in _run
    self._test._abort_socket_test(ex)
  File "/home/vstinner/prog/python/master/Lib/test/test_asyncio/functional.py", line 122, in _abort_socket_test
    self.fail(ex)
  File "/home/vstinner/prog/python/master/Lib/unittest/case.py", line 680, in fail
    raise self.failureException(msg)
AssertionError: [Errno 0] Error

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

(...)

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

/home/vstinner/prog/python/master/Lib/test/test_asyncio/functional.py:272: ResourceWarning: unclosed <socket.socket fd=13, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 46551), raddr=('127.0.0.1', 34620)>
  self._prog(TestSocketWrapper(sock))
/home/vstinner/prog/python/master/Lib/asyncio/sslproto.py:322: ResourceWarning: unclosed transport <asyncio.sslproto._SSLProtocolTransport object at 0x7f74c1ac6400>
  source=self)
ok

(...)


I'm working on a fix.

----------
components: asyncio
messages: 318864
nosy: asvetlov, vstinner, yselivanov
priority: normal
severity: normal
status: open
title: test_asyncio emits ResourceWarning warnings
versions: Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33789>
_______________________________________


More information about the New-bugs-announce mailing list