You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test_nntplib depends on unreliable external servers #84912
Traceback (most recent call last):
File "/Users/runner/runners/2.262.1/work/cpython/cpython/Lib/test/test_nntplib.py", line 277, in test_with_statement
server =self.NNTP_CLASS(self.NNTP_HOST,
File "/Users/runner/runners/2.262.1/work/cpython/cpython/Lib/nntplib.py", line 1025, in __init__super().__init__(host, port, user, password, readermode,
File "/Users/runner/runners/2.262.1/work/cpython/cpython/Lib/nntplib.py", line 334, in __init__self.sock =self._create_socket(timeout)
File "/Users/runner/runners/2.262.1/work/cpython/cpython/Lib/nntplib.py", line 1031, in _create_socket
sock = _encrypt_on(sock, self.ssl_context, self.host)
File "/Users/runner/runners/2.262.1/work/cpython/cpython/Lib/nntplib.py", line 292, in _encrypt_onreturn context.wrap_socket(sock, server_hostname=hostname)
File "/Users/runner/runners/2.262.1/work/cpython/cpython/Lib/ssl.py", line 500, in wrap_socketreturnself.sslsocket_class._create(
File "/Users/runner/runners/2.262.1/work/cpython/cpython/Lib/ssl.py", line 1040, in _createself.do_handshake()
File "/Users/runner/runners/2.262.1/work/cpython/cpython/Lib/ssl.py", line 1309, in do_handshakeself._sslobj.do_handshake()
ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:1097)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/runner/runners/2.262.1/work/cpython/cpython/Lib/test/test_nntplib.py", line 250, in wrapped
meth(self)
File "/Users/runner/runners/2.262.1/work/cpython/cpython/Lib/test/test_nntplib.py", line 293, in test_with_statementif re.search(r'(?i)KEY.TOO.SMALL', ssl_err.reason):
File "/Users/runner/runners/2.262.1/work/cpython/cpython/Lib/re.py", line 201, in searchreturn _compile(pattern, flags).search(string)
TypeError: expected string or bytes-like object
Following discussion with Zach and Victor: This is probably an issue with the external servers these tests used. The fix would be to rewrite the tests so that they don't rely on external infrastructure.
changed the title [-]test_nntplib: sporadic failures, NetworkedNNTP_SSLTests.test_with_statement[/-][+]test_nntplib depends on unreliable external servers[/+]on Jan 24, 2022
changed the title [-]test_nntplib: sporadic failures, NetworkedNNTP_SSLTests.test_with_statement[/-][+]test_nntplib depends on unreliable external servers[/+]on Jan 24, 2022
These issues are open for 9 years. NNTP protocol is getting less and less popular, I don't expect that anyone will come in 2022 and suddenly propose a fix.
It tomorrow a test_nntplib test fails too often, I suggest to simply skip it, since PEP-594 is accepted. Especially tests using external real NNTP servers.
Activity
cjerdonek commentedon May 22, 2020
A sporadic failure of test_nntplib.NetworkedNNTP_SSLTests.test_with_statement on the CI for macOS:
https://github.com/python/cpython/pull/20321/checks?check_run_id=700729471#step:6:612
See also:
ERROR: test_with_statement (test.test_nntplib.NetworkedNNTP_SSLTests)
----------------------------------------------------------------------
iritkatriel commentedon Jan 24, 2022
Following discussion with Zach and Victor: This is probably an issue with the external servers these tests used. The fix would be to rewrite the tests so that they don't rely on external infrastructure.
[-]test_nntplib: sporadic failures, NetworkedNNTP_SSLTests.test_with_statement[/-][+]test_nntplib depends on unreliable external servers[/+][-]test_nntplib: sporadic failures, NetworkedNNTP_SSLTests.test_with_statement[/-][+]test_nntplib depends on unreliable external servers[/+]vstinner commentedon Jan 25, 2022
IMO for now it's better to *always* skip test_nnptlib tests which rely on external servers and close related issues.
These issues are open for 9 years. NNTP protocol is getting less and less popular, I don't expect that anyone will come in 2022 and suddenly propose a fix.
iritkatriel commentedon Mar 13, 2022
nntplib is deprecated as per PEP-594, so there won't be further enhancements to it.
vstinner commentedon Mar 14, 2022
It tomorrow a test_nntplib test fails too often, I suggest to simply skip it, since PEP-594 is accepted. Especially tests using external real NNTP servers.