question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Python 3.7 test failures (SSL related)

See original GitHub issue

https://travis-ci.org/hroncok/HTTPretty/jobs/381122886

   AssertionError: Traceback (most recent call last):
     File "/opt/python/3.7-dev/lib/python3.7/urllib/request.py", line 1316, in do_open
       encode_chunked=req.has_header('Transfer-encoding'))
     File "/opt/python/3.7-dev/lib/python3.7/http/client.py", line 1229, in request
       self._send_request(method, url, body, headers, encode_chunked)
     File "/opt/python/3.7-dev/lib/python3.7/http/client.py", line 1275, in _send_request
       self.endheaders(body, encode_chunked=encode_chunked)
     File "/opt/python/3.7-dev/lib/python3.7/http/client.py", line 1224, in endheaders
       self._send_output(message_body, encode_chunked=encode_chunked)
     File "/opt/python/3.7-dev/lib/python3.7/http/client.py", line 1016, in _send_output
       self.send(msg)
     File "/opt/python/3.7-dev/lib/python3.7/http/client.py", line 977, in send
       self.sock.sendall(data)
     File "/opt/python/3.7-dev/lib/python3.7/ssl.py", line 987, in sendall
       return socket.sendall(self, data, flags)
   BrokenPipeError: [Errno 32] Broken pipe
   
   During handling of the above exception, another exception occurred:
   
   Traceback (most recent call last):
     File "/home/travis/virtualenv/python3.7-dev/lib/python3.7/site-packages/sure/__init__.py", line 186, in wrap
       func(start, *args, **kw)
     File "/home/travis/build/hroncok/HTTPretty/tests/functional/test_urllib2.py", line 191, in test_httpretty_should_support_a_list_of_successive_responses_urllib2
       request1 = urlopen('https://api.yahoo.com/test')
     File "/opt/python/3.7-dev/lib/python3.7/urllib/request.py", line 222, in urlopen
       return opener.open(url, data, timeout)
     File "/opt/python/3.7-dev/lib/python3.7/urllib/request.py", line 525, in open
       response = self._open(req, data)
     File "/opt/python/3.7-dev/lib/python3.7/urllib/request.py", line 543, in _open
       '_open', req)
     File "/opt/python/3.7-dev/lib/python3.7/urllib/request.py", line 503, in _call_chain
       result = func(*args)
     File "/opt/python/3.7-dev/lib/python3.7/urllib/request.py", line 1359, in https_open
       context=self._context, check_hostname=self._check_hostname)
     File "/opt/python/3.7-dev/lib/python3.7/urllib/request.py", line 1318, in do_open
       raise URLError(err)

https://travis-ci.org/hroncok/HTTPretty/jobs/381122887

   Traceback (most recent call last):
    /home/travis/virtualenv/python3.7-dev/lib/python3.7/site-packages/nose/case.py line 198 in runTest
      self.test(*self.arg)
    httpretty/core.py line 1631 in wrapper
      return test(*args, **kw)
    tests/pyopenssl/test_mock.py line 42 in test_httpretty_overrides_when_pyopenssl_installed
      response = requests.get('https://yipit.com')
    /home/travis/virtualenv/python3.7-dev/lib/python3.7/site-packages/requests/api.py line 72 in get
      return request('get', url, params=params, **kwargs)
    /home/travis/virtualenv/python3.7-dev/lib/python3.7/site-packages/requests/api.py line 58 in request
      return session.request(method=method, url=url, **kwargs)
    /home/travis/virtualenv/python3.7-dev/lib/python3.7/site-packages/requests/sessions.py line 508 in request
      resp = self.send(prep, **send_kwargs)
    /home/travis/virtualenv/python3.7-dev/lib/python3.7/site-packages/requests/sessions.py line 618 in send
      r = adapter.send(request, **kwargs)
    /home/travis/virtualenv/python3.7-dev/lib/python3.7/site-packages/requests/adapters.py line 506 in send
      raise SSLError(e, request=request)
   SSLError: HTTPSConnectionPool(host='yipit.com', port=443): Max retries exceeded with url: / (Caused by SSLError(CertificateError("wildcard can only be present in the leftmost segment: '*yipit.com'")))

Also with Python 3.7.0b4 on Fedora:

AssertionError: Traceback (most recent call last):
     File "/home/churchyard/Dokumenty/RedHat/HTTPretty/.tox/py37/lib/python3.7/site-packages/sure/__init__.py", line 186, in wrap
       func(start, *args, **kw)
     File "/home/churchyard/Dokumenty/RedHat/HTTPretty/tests/functional/test_httplib2.py", line 278, in test_callback_response
       'https://api.yahoo.com/test', 'GET')
     File "/home/churchyard/Dokumenty/RedHat/HTTPretty/.tox/py37/lib/python3.7/site-packages/httplib2/__init__.py", line 1514, in request
       (response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
     File "/home/churchyard/Dokumenty/RedHat/HTTPretty/.tox/py37/lib/python3.7/site-packages/httplib2/__init__.py", line 1264, in _request
       (response, content) = self._conn_request(conn, request_uri, method, body, headers)
     File "/home/churchyard/Dokumenty/RedHat/HTTPretty/.tox/py37/lib/python3.7/site-packages/httplib2/__init__.py", line 1187, in _conn_request
       conn.connect()
     File "/home/churchyard/Dokumenty/RedHat/HTTPretty/.tox/py37/lib/python3.7/site-packages/httplib2/__init__.py", line 1013, in connect
       self.sock = self._context.wrap_socket(sock, server_hostname=self.host)
     File "/usr/lib64/python3.7/ssl.py", line 412, in wrap_socket
       session=session
     File "/usr/lib64/python3.7/ssl.py", line 817, in _create
       super(SSLSocket, self).__init__(**kwargs)
   TypeError: super(type, obj): obj must be an instance or subtype of type

But fallbacks to broken pipe above if I do crazy changes in SSLSocket from the stdlib.

cc @tiran because I have no idea what’s going on here.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:20 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
hroncokcommented, Jun 7, 2018

I’ve tested with 2.7.15 actually.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Installing Python 3.7 from source: test_ssl failed
The test fails due to an behavior change in OpenSSL 1.1.1e. Try with OpenSSL 1.1.1d for now. See https://bugs.python.org/issue40018 for more ...
Read more >
Building Python 3.7.1 - SSL module failed
First of all, in my case, OpenSSL did not build correctly, as make test did return errors (and consequently Python gave this error)....
Read more >
Issue 34028: Python 3.7.0 wont compile with SSL Support 1.1 ...
when compiling Python 3.7.0 setup.py is reporting that the ssl module failed to compile due to missing support for X509_VERIFY_PARAM_set1_host() ...
Read more >
test_ssl fails in Ubuntu 20.04: test_min_max_version_mismatch
Just tested python 3.9. 0 - same issue. It sounds like a Debian/Ubuntu patch is breaking an assumption.
Read more >
Issue 35925: test_httplib test_nntplib test_ssl fail on ARMv7 ...
Does the test also fail with the env var OPENSSL_CONF set to a ... in Python 3.7). https://docs.python.org/dev/library/ssl.html#ssl.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found