Skip to content

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

Closed

Description

@xnox
mannequin
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']

    Activity

    1. xnox commented on Sep 27, 2018

      xnoxmannequin
      MannequinAuthor

      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

    2. added
      type-bug
      on Sep 27, 2018
    3. xnox commented on Sep 28, 2018

      xnoxmannequin
      MannequinAuthor

      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?

    4. tiran commented on Sep 28, 2018

      @tiran
      Member

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

    5. csabella commented on May 29, 2019

      @csabella
      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.

    6. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    Labels

    deferred-blockertopic-SSLtype-bug

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions