classification
Title: test.test_ssl.ThreadedTests.test_tls1_3 fails in 2.7 with AttributeError: __exit__
Type: behavior Stage: patch review
Components: SSL Versions: Python 2.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: christian.heimes Nosy List: christian.heimes, cstratak, xnox, xtreak
Priority: deferred blocker Keywords: patch

Created on 2018-09-27 09:07 by xnox, last changed 2018-10-01 19:40 by cstratak.

Pull Requests
URL Status Linked Edit
PR 9622 open python-dev, 2018-09-28 13:23
Messages (3)
msg326534 - (view) Author: Dimitri John Ledkov (xnox) * Date: 2018-09-27 09:07
test.test_ssl.ThreadedTests.test_tls1_3 fails in 2.7 with AttributeError: __exit__

When building python 2.7, update to 20180926 from the 2.7 branch, on Ubuntu 18.10 (cosmic) with OpenSSL 1.1.1 the test_ssl errors out like so:

======================================================================
ERROR: test_tls1_3 (test.test_ssl.ThreadedTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/test/test_ssl.py", line 2815, in test_tls1_3
    with context.wrap_socket(socket.socket()) as s:
AttributeError: __exit__

Distribution issue https://bugs.launchpad.net/ubuntu/+source/python2.7/+bug/1759172
msg326599 - (view) Author: Dimitri John Ledkov (xnox) * Date: 2018-09-28 01:14
Similar client sockets are used in that file, but they are wrapped in extra `with closing(...) as s:`

Is closing() wrapper missing in this test case?
msg326612 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2018-09-28 06:58
Yes, that's it. In Python 2.7, socket classes don't implement the context manager protocol.
History
Date User Action Args
2018-10-01 19:40:08cstrataksetnosy: + cstratak
2018-09-28 13:23:34python-devsetkeywords: + patch
stage: needs patch -> patch review
pull_requests: + pull_request9020
2018-09-28 06:58:36christian.heimessetmessages: + msg326612
2018-09-28 01:14:31xnoxsetmessages: + msg326599
2018-09-27 09:46:07christian.heimessetpriority: normal -> deferred blocker
type: behavior
stage: needs patch
2018-09-27 09:36:26xtreaksetnosy: + xtreak
2018-09-27 09:07:11xnoxcreate