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: test.test_ssl.ThreadedTests.test_tls1_3 fails in 2.7 with AttributeError: __exit__
Type: behavior Stage: resolved
Components: SSL Versions: Python 2.7
process
Status: closed Resolution: duplicate
Dependencies: Superseder: Sane defaults for SSLContext options and ciphers
View: 28043
Assigned To: christian.heimes Nosy List: cheryl.sabella, christian.heimes, cstratak, xnox, xtreak
Priority: deferred blocker Keywords: patch

Created on 2018-09-27 09:07 by xnox, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 9622 closed python-dev, 2018-09-28 13:23
Messages (4)
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.
msg343848 - (view) Author: Cheryl Sabella (cheryl.sabella) * (Python committer) Date: 2019-05-29 01:17
Thank you for the report and the pull request.  This was fixed as part of issue28043, so I'm closing this as a duplicate.
History
Date User Action Args
2022-04-11 14:59:06adminsetgithub: 78999
2019-05-29 01:17:06cheryl.sabellasetstatus: open -> closed

superseder: Sane defaults for SSLContext options and ciphers

nosy: + cheryl.sabella
messages: + msg343848
resolution: duplicate
stage: patch review -> resolved
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