Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test.test_ssl.ThreadedTests.test_tls1_3 fails in 2.7 with AttributeError: __exit__ #78999

Closed
xnox mannequin opened this issue Sep 27, 2018 · 4 comments
Closed

test.test_ssl.ThreadedTests.test_tls1_3 fails in 2.7 with AttributeError: __exit__ #78999

xnox mannequin opened this issue Sep 27, 2018 · 4 comments
Assignees
Labels
deferred-blocker topic-SSL type-bug An unexpected behavior, bug, or error

Comments

@xnox
Copy link
Mannequin

xnox mannequin commented Sep 27, 2018

BPO 34818
Nosy @tiran, @xnox, @stratakis, @csabella, @tirkarthi
PRs
  • bpo-34818: Add missing closing() wrapper in test_tls1_3. #9622
  • Superseder
  • bpo-28043: Sane defaults for SSLContext options and ciphers
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/tiran'
    closed_at = <Date 2019-05-29.01:17:06.058>
    created_at = <Date 2018-09-27.09:07:11.115>
    labels = ['expert-SSL', 'deferred-blocker', 'type-bug']
    title = 'test.test_ssl.ThreadedTests.test_tls1_3 fails in 2.7 with AttributeError: __exit__'
    updated_at = <Date 2019-05-29.01:17:06.052>
    user = 'https://github.com/xnox'

    bugs.python.org fields:

    activity = <Date 2019-05-29.01:17:06.052>
    actor = 'cheryl.sabella'
    assignee = 'christian.heimes'
    closed = True
    closed_date = <Date 2019-05-29.01:17:06.058>
    closer = 'cheryl.sabella'
    components = ['SSL']
    creation = <Date 2018-09-27.09:07:11.115>
    creator = 'xnox'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 34818
    keywords = ['patch']
    message_count = 4.0
    messages = ['326534', '326599', '326612', '343848']
    nosy_count = 5.0
    nosy_names = ['christian.heimes', 'xnox', 'cstratak', 'cheryl.sabella', 'xtreak']
    pr_nums = ['9622']
    priority = 'deferred blocker'
    resolution = 'duplicate'
    stage = 'resolved'
    status = 'closed'
    superseder = '28043'
    type = 'behavior'
    url = 'https://bugs.python.org/issue34818'
    versions = ['Python 2.7']

    @xnox
    Copy link
    Mannequin Author

    xnox mannequin commented Sep 27, 2018

    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

    @xnox xnox mannequin assigned tiran Sep 27, 2018
    @xnox xnox mannequin added the topic-SSL label Sep 27, 2018
    @tiran tiran added deferred-blocker type-bug An unexpected behavior, bug, or error labels Sep 27, 2018
    @xnox
    Copy link
    Mannequin Author

    xnox mannequin commented Sep 28, 2018

    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?

    @tiran
    Copy link
    Member

    tiran commented Sep 28, 2018

    Yes, that's it. In Python 2.7, socket classes don't implement the context manager protocol.

    @csabella
    Copy link
    Contributor

    Thank you for the report and the pull request. This was fixed as part of bpo-28043, so I'm closing this as a duplicate.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    deferred-blocker topic-SSL type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants