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 regressions with Python 3.13.0b2 #848

Closed
mgorny opened this issue Jun 28, 2024 · 7 comments
Closed

Test regressions with Python 3.13.0b2 #848

mgorny opened this issue Jun 28, 2024 · 7 comments

Comments

@mgorny
Copy link
Contributor

mgorny commented Jun 28, 2024

Compared to Python 3.12, I'm seeing a few new failing tests:

$ EPYTHON=python3.13 bash runtests.sh --deselect tests/integration/test_urllib2.py::test_multiple_requests --deselect tests/integration/test_urllib2.py::test_random_body tests/integration/test_urllib2.py 
/usr/lib/python3.13/site-packages/httpbin/helpers.py:32: SyntaxWarning: invalid escape sequence '\_'
  ASCII_ART = """
/usr/lib/python3.13/site-packages/httpbin/helpers.py:77: SyntaxWarning: invalid escape sequence '\ '
  ANGRY_ASCII ="""
/usr/lib/python3.13/site-packages/httpbin/helpers.py:444: SyntaxWarning: invalid escape sequence '\s'
  match = re.search('\s*(W/)?\"?([^"]*)\"?\s*', part)
[2024-06-28 20:55:41,591] WARNING in core: Swagger not found, legacy index will be used.
========================================================= test session starts =========================================================
platform linux -- Python 3.13.0b3, pytest-8.2.2, pluggy-1.5.0
rootdir: /tmp/vcrpy
configfile: pyproject.toml
plugins: xdist-3.6.1, subtests-0.12.1, asyncio-0.23.7, xprocess-1.0.2, anyio-4.4.0, pkgcore-0.12.27, hypothesis-6.103.5, timeout-2.3.1, httpbin-2.0.0
asyncio: mode=Mode.STRICT
collected 18 items / 4 deselected / 14 selected                                                                                       

tests/integration/test_urllib2.py ......pytest-httpbin server hit an exception serving request: [SSL: SSLV3_ALERT_CERTIFICATE_UNKNOWN] ssl/tls alert certificate unknown (_ssl.c:1024)
attempting to ignore so the rest of the tests can run
Fpytest-httpbin server hit an exception serving request: [SSL: SSLV3_ALERT_CERTIFICATE_UNKNOWN] ssl/tls alert certificate unknown (_ssl.c:1024)
attempting to ignore so the rest of the tests can run
Fpytest-httpbin server hit an exception serving request: [SSL: SSLV3_ALERT_CERTIFICATE_UNKNOWN] ssl/tls alert certificate unknown (_ssl.c:1024)
attempting to ignore so the rest of the tests can run
Fpytest-httpbin server hit an exception serving request: [SSL: SSLV3_ALERT_CERTIFICATE_UNKNOWN] ssl/tls alert certificate unknown (_ssl.c:1024)
attempting to ignore so the rest of the tests can run
Fpytest-httpbin server hit an exception serving request: [SSL: SSLV3_ALERT_CERTIFICATE_UNKNOWN] ssl/tls alert certificate unknown (_ssl.c:1024)
attempting to ignore so the rest of the tests can run
Fpytest-httpbin server hit an exception serving request: [SSL: SSLV3_ALERT_CERTIFICATE_UNKNOWN] ssl/tls alert certificate unknown (_ssl.c:1024)
attempting to ignore so the rest of the tests can run
F.pytest-httpbin server hit an exception serving request: [SSL: SSLV3_ALERT_CERTIFICATE_UNKNOWN] ssl/tls alert certificate unknown (_ssl.c:1024)
attempting to ignore so the rest of the tests can run
F                                                                                [100%]

============================================================== FAILURES ===============================================================
______________________________________________________ test_response_code[https] ______________________________________________________

httpbin_both = <pytest_httpbin.serve.SecureServer object at 0x7f073b7ef0e0>
tmpdir = local('/tmp/pytest-of-mgorny/pytest-5/test_response_code_https_0')

    def test_response_code(httpbin_both, tmpdir):
        """Ensure we can read a response code from a fetch"""
        url = httpbin_both.url
        with vcr.use_cassette(str(tmpdir.join("atts.yaml"))):
>           code = urlopen_with_cafile(url).getcode()

tests/integration/test_urllib2.py:32: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/integration/test_urllib2.py:21: in urlopen_with_cafile
    return urlopen(*args, **kwargs)
/usr/lib/python3.13/urllib/request.py:189: in urlopen
    return opener.open(url, data, timeout)
/usr/lib/python3.13/urllib/request.py:489: in open
    response = self._open(req, data)
/usr/lib/python3.13/urllib/request.py:506: in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
/usr/lib/python3.13/urllib/request.py:466: in _call_chain
    result = func(*args)
/usr/lib/python3.13/urllib/request.py:1367: in https_open
    return self.do_open(http.client.HTTPSConnection, req,
/usr/lib/python3.13/urllib/request.py:1323: in do_open
    r = h.getresponse()
vcr/stubs/__init__.py:277: in getresponse
    self.real_connection.request(
/usr/lib/python3.13/http/client.py:1336: in request
    self._send_request(method, url, body, headers, encode_chunked)
/usr/lib/python3.13/http/client.py:1382: in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
/usr/lib/python3.13/http/client.py:1331: in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
/usr/lib/python3.13/http/client.py:1091: in _send_output
    self.send(msg)
/usr/lib/python3.13/http/client.py:1035: in send
    self.connect()
/usr/lib/python3.13/http/client.py:1477: in connect
    self.sock = self._context.wrap_socket(self.sock,
/usr/lib/python3.13/ssl.py:455: in wrap_socket
    return self.sslsocket_class._create(
/usr/lib/python3.13/ssl.py:1077: in _create
    self.do_handshake()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <ssl.SSLSocket [closed] fd=-1, family=2, type=1, proto=6>, block = False

    @_sslcopydoc
    def do_handshake(self, block=False):
        self._check_connected()
        timeout = self.gettimeout()
        try:
            if timeout == 0.0 and block:
                self.settimeout(None)
>           self._sslobj.do_handshake()
E           ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Missing Authority Key Identifier (_ssl.c:1024)

/usr/lib/python3.13/ssl.py:1363: SSLCertVerificationError
____________________________________________________ test_response_headers[https] _____________________________________________________

httpbin_both = <pytest_httpbin.serve.SecureServer object at 0x7f073b7ef0e0>
tmpdir = local('/tmp/pytest-of-mgorny/pytest-5/test_response_headers_https_0')

    def test_response_headers(httpbin_both, tmpdir):
        """Ensure we can get information from the response"""
        url = httpbin_both.url
        with vcr.use_cassette(str(tmpdir.join("headers.yaml"))):
>           open1 = urlopen_with_cafile(url).info().items()

tests/integration/test_urllib2.py:52: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/integration/test_urllib2.py:21: in urlopen_with_cafile
    return urlopen(*args, **kwargs)
/usr/lib/python3.13/urllib/request.py:189: in urlopen
    return opener.open(url, data, timeout)
/usr/lib/python3.13/urllib/request.py:489: in open
    response = self._open(req, data)
/usr/lib/python3.13/urllib/request.py:506: in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
/usr/lib/python3.13/urllib/request.py:466: in _call_chain
    result = func(*args)
/usr/lib/python3.13/urllib/request.py:1367: in https_open
    return self.do_open(http.client.HTTPSConnection, req,
/usr/lib/python3.13/urllib/request.py:1323: in do_open
    r = h.getresponse()
vcr/stubs/__init__.py:277: in getresponse
    self.real_connection.request(
/usr/lib/python3.13/http/client.py:1336: in request
    self._send_request(method, url, body, headers, encode_chunked)
/usr/lib/python3.13/http/client.py:1382: in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
/usr/lib/python3.13/http/client.py:1331: in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
/usr/lib/python3.13/http/client.py:1091: in _send_output
    self.send(msg)
/usr/lib/python3.13/http/client.py:1035: in send
    self.connect()
/usr/lib/python3.13/http/client.py:1477: in connect
    self.sock = self._context.wrap_socket(self.sock,
/usr/lib/python3.13/ssl.py:455: in wrap_socket
    return self.sslsocket_class._create(
/usr/lib/python3.13/ssl.py:1077: in _create
    self.do_handshake()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <ssl.SSLSocket [closed] fd=-1, family=2, type=1, proto=6>, block = False

    @_sslcopydoc
    def do_handshake(self, block=False):
        self._check_connected()
        timeout = self.gettimeout()
        try:
            if timeout == 0.0 and block:
                self.settimeout(None)
>           self._sslobj.do_handshake()
E           ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Missing Authority Key Identifier (_ssl.c:1024)

/usr/lib/python3.13/ssl.py:1363: SSLCertVerificationError
________________________________________________________ test_get_data[https] _________________________________________________________

httpbin_both = <pytest_httpbin.serve.SecureServer object at 0x7f073b7ef0e0>
tmpdir = local('/tmp/pytest-of-mgorny/pytest-5/test_get_data_https_0')

    def test_get_data(httpbin_both, tmpdir):
        """Ensure that it works with query data"""
        data = urlencode({"some": 1, "data": "here"})
        url = httpbin_both.url + "/get?" + data
        with vcr.use_cassette(str(tmpdir.join("get_data.yaml"))):
>           res1 = urlopen_with_cafile(url).read()

tests/integration/test_urllib2.py:86: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/integration/test_urllib2.py:21: in urlopen_with_cafile
    return urlopen(*args, **kwargs)
/usr/lib/python3.13/urllib/request.py:189: in urlopen
    return opener.open(url, data, timeout)
/usr/lib/python3.13/urllib/request.py:489: in open
    response = self._open(req, data)
/usr/lib/python3.13/urllib/request.py:506: in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
/usr/lib/python3.13/urllib/request.py:466: in _call_chain
    result = func(*args)
/usr/lib/python3.13/urllib/request.py:1367: in https_open
    return self.do_open(http.client.HTTPSConnection, req,
/usr/lib/python3.13/urllib/request.py:1323: in do_open
    r = h.getresponse()
vcr/stubs/__init__.py:277: in getresponse
    self.real_connection.request(
/usr/lib/python3.13/http/client.py:1336: in request
    self._send_request(method, url, body, headers, encode_chunked)
/usr/lib/python3.13/http/client.py:1382: in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
/usr/lib/python3.13/http/client.py:1331: in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
/usr/lib/python3.13/http/client.py:1091: in _send_output
    self.send(msg)
/usr/lib/python3.13/http/client.py:1035: in send
    self.connect()
/usr/lib/python3.13/http/client.py:1477: in connect
    self.sock = self._context.wrap_socket(self.sock,
/usr/lib/python3.13/ssl.py:455: in wrap_socket
    return self.sslsocket_class._create(
/usr/lib/python3.13/ssl.py:1077: in _create
    self.do_handshake()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <ssl.SSLSocket [closed] fd=-1, family=2, type=1, proto=6>, block = False

    @_sslcopydoc
    def do_handshake(self, block=False):
        self._check_connected()
        timeout = self.gettimeout()
        try:
            if timeout == 0.0 and block:
                self.settimeout(None)
>           self._sslobj.do_handshake()
E           ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Missing Authority Key Identifier (_ssl.c:1024)

/usr/lib/python3.13/ssl.py:1363: SSLCertVerificationError
________________________________________________________ test_post_data[https] ________________________________________________________

httpbin_both = <pytest_httpbin.serve.SecureServer object at 0x7f073b7ef0e0>
tmpdir = local('/tmp/pytest-of-mgorny/pytest-5/test_post_data_https_0')

    def test_post_data(httpbin_both, tmpdir):
        """Ensure that it works when posting data"""
        data = urlencode({"some": 1, "data": "here"}).encode("utf-8")
        url = httpbin_both.url + "/post"
        with vcr.use_cassette(str(tmpdir.join("post_data.yaml"))):
>           res1 = urlopen_with_cafile(url, data).read()

tests/integration/test_urllib2.py:98: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/integration/test_urllib2.py:21: in urlopen_with_cafile
    return urlopen(*args, **kwargs)
/usr/lib/python3.13/urllib/request.py:189: in urlopen
    return opener.open(url, data, timeout)
/usr/lib/python3.13/urllib/request.py:489: in open
    response = self._open(req, data)
/usr/lib/python3.13/urllib/request.py:506: in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
/usr/lib/python3.13/urllib/request.py:466: in _call_chain
    result = func(*args)
/usr/lib/python3.13/urllib/request.py:1367: in https_open
    return self.do_open(http.client.HTTPSConnection, req,
/usr/lib/python3.13/urllib/request.py:1323: in do_open
    r = h.getresponse()
vcr/stubs/__init__.py:277: in getresponse
    self.real_connection.request(
/usr/lib/python3.13/http/client.py:1336: in request
    self._send_request(method, url, body, headers, encode_chunked)
/usr/lib/python3.13/http/client.py:1382: in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
/usr/lib/python3.13/http/client.py:1331: in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
/usr/lib/python3.13/http/client.py:1091: in _send_output
    self.send(msg)
/usr/lib/python3.13/http/client.py:1035: in send
    self.connect()
/usr/lib/python3.13/http/client.py:1477: in connect
    self.sock = self._context.wrap_socket(self.sock,
/usr/lib/python3.13/ssl.py:455: in wrap_socket
    return self.sslsocket_class._create(
/usr/lib/python3.13/ssl.py:1077: in _create
    self.do_handshake()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <ssl.SSLSocket [closed] fd=-1, family=2, type=1, proto=6>, block = False

    @_sslcopydoc
    def do_handshake(self, block=False):
        self._check_connected()
        timeout = self.gettimeout()
        try:
            if timeout == 0.0 and block:
                self.settimeout(None)
>           self._sslobj.do_handshake()
E           ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Missing Authority Key Identifier (_ssl.c:1024)

/usr/lib/python3.13/ssl.py:1363: SSLCertVerificationError
____________________________________________________ test_post_unicode_data[https] ____________________________________________________

httpbin_both = <pytest_httpbin.serve.SecureServer object at 0x7f073b7ef0e0>
tmpdir = local('/tmp/pytest-of-mgorny/pytest-5/test_post_unicode_data_https_0')

    def test_post_unicode_data(httpbin_both, tmpdir):
        """Ensure that it works when posting unicode data"""
        data = urlencode({"snowman": "".encode()}).encode("utf-8")
        url = httpbin_both.url + "/post"
        with vcr.use_cassette(str(tmpdir.join("post_data.yaml"))):
>           res1 = urlopen_with_cafile(url, data).read()

tests/integration/test_urllib2.py:113: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/integration/test_urllib2.py:21: in urlopen_with_cafile
    return urlopen(*args, **kwargs)
/usr/lib/python3.13/urllib/request.py:189: in urlopen
    return opener.open(url, data, timeout)
/usr/lib/python3.13/urllib/request.py:489: in open
    response = self._open(req, data)
/usr/lib/python3.13/urllib/request.py:506: in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
/usr/lib/python3.13/urllib/request.py:466: in _call_chain
    result = func(*args)
/usr/lib/python3.13/urllib/request.py:1367: in https_open
    return self.do_open(http.client.HTTPSConnection, req,
/usr/lib/python3.13/urllib/request.py:1323: in do_open
    r = h.getresponse()
vcr/stubs/__init__.py:277: in getresponse
    self.real_connection.request(
/usr/lib/python3.13/http/client.py:1336: in request
    self._send_request(method, url, body, headers, encode_chunked)
/usr/lib/python3.13/http/client.py:1382: in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
/usr/lib/python3.13/http/client.py:1331: in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
/usr/lib/python3.13/http/client.py:1091: in _send_output
    self.send(msg)
/usr/lib/python3.13/http/client.py:1035: in send
    self.connect()
/usr/lib/python3.13/http/client.py:1477: in connect
    self.sock = self._context.wrap_socket(self.sock,
/usr/lib/python3.13/ssl.py:455: in wrap_socket
    return self.sslsocket_class._create(
/usr/lib/python3.13/ssl.py:1077: in _create
    self.do_handshake()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <ssl.SSLSocket [closed] fd=-1, family=2, type=1, proto=6>, block = False

    @_sslcopydoc
    def do_handshake(self, block=False):
        self._check_connected()
        timeout = self.gettimeout()
        try:
            if timeout == 0.0 and block:
                self.settimeout(None)
>           self._sslobj.do_handshake()
E           ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Missing Authority Key Identifier (_ssl.c:1024)

/usr/lib/python3.13/ssl.py:1363: SSLCertVerificationError
________________________________________________________ test_decorator[https] ________________________________________________________

httpbin_both = <pytest_httpbin.serve.SecureServer object at 0x7f073b7ef0e0>
tmpdir = local('/tmp/pytest-of-mgorny/pytest-5/test_decorator_https_0')

    def test_decorator(httpbin_both, tmpdir):
        """Test the decorator version of VCR.py"""
        url = httpbin_both.url
    
        @vcr.use_cassette(str(tmpdir.join("atts.yaml")))
        def inner1():
            return urlopen_with_cafile(url).getcode()
    
        @vcr.use_cassette(str(tmpdir.join("atts.yaml")))
        def inner2():
            return urlopen_with_cafile(url).getcode()
    
>       assert inner1() == inner2()

tests/integration/test_urllib2.py:147: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
vcr/cassette.py:107: in __call__
    return type(self)(self.cls, args_getter)._execute_function(function, args, kwargs)
vcr/cassette.py:121: in _execute_function
    return self._handle_function(fn=handle_function)
vcr/cassette.py:132: in _handle_function
    return fn(cassette)
vcr/cassette.py:114: in handle_function
    return function(*args, **kwargs)
tests/integration/test_urllib2.py:141: in inner1
    return urlopen_with_cafile(url).getcode()
tests/integration/test_urllib2.py:21: in urlopen_with_cafile
    return urlopen(*args, **kwargs)
/usr/lib/python3.13/urllib/request.py:189: in urlopen
    return opener.open(url, data, timeout)
/usr/lib/python3.13/urllib/request.py:489: in open
    response = self._open(req, data)
/usr/lib/python3.13/urllib/request.py:506: in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
/usr/lib/python3.13/urllib/request.py:466: in _call_chain
    result = func(*args)
/usr/lib/python3.13/urllib/request.py:1367: in https_open
    return self.do_open(http.client.HTTPSConnection, req,
/usr/lib/python3.13/urllib/request.py:1323: in do_open
    r = h.getresponse()
vcr/stubs/__init__.py:277: in getresponse
    self.real_connection.request(
/usr/lib/python3.13/http/client.py:1336: in request
    self._send_request(method, url, body, headers, encode_chunked)
/usr/lib/python3.13/http/client.py:1382: in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
/usr/lib/python3.13/http/client.py:1331: in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
/usr/lib/python3.13/http/client.py:1091: in _send_output
    self.send(msg)
/usr/lib/python3.13/http/client.py:1035: in send
    self.connect()
/usr/lib/python3.13/http/client.py:1477: in connect
    self.sock = self._context.wrap_socket(self.sock,
/usr/lib/python3.13/ssl.py:455: in wrap_socket
    return self.sslsocket_class._create(
/usr/lib/python3.13/ssl.py:1077: in _create
    self.do_handshake()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <ssl.SSLSocket [closed] fd=-1, family=2, type=1, proto=6>, block = False

    @_sslcopydoc
    def do_handshake(self, block=False):
        self._check_connected()
        timeout = self.gettimeout()
        try:
            if timeout == 0.0 and block:
                self.settimeout(None)
>           self._sslobj.do_handshake()
E           ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Missing Authority Key Identifier (_ssl.c:1024)

/usr/lib/python3.13/ssl.py:1363: SSLCertVerificationError
__________________________________________________________ test_cross_scheme __________________________________________________________

tmpdir = local('/tmp/pytest-of-mgorny/pytest-5/test_cross_scheme0')
httpbin_secure = <pytest_httpbin.serve.SecureServer object at 0x7f073b7ef0e0>
httpbin = <pytest_httpbin.serve.Server object at 0x7f073b7ef230>

    def test_cross_scheme(tmpdir, httpbin_secure, httpbin):
        """Ensure that requests between schemes are treated separately"""
        # First fetch a url under https, and then again under https and then
        # ensure that we haven't served anything out of cache, and we have two
        # requests / response pairs in the cassette
        with vcr.use_cassette(str(tmpdir.join("cross_scheme.yaml"))) as cass:
>           urlopen_with_cafile(httpbin_secure.url)

tests/integration/test_urllib2.py:129: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/integration/test_urllib2.py:21: in urlopen_with_cafile
    return urlopen(*args, **kwargs)
/usr/lib/python3.13/urllib/request.py:189: in urlopen
    return opener.open(url, data, timeout)
/usr/lib/python3.13/urllib/request.py:489: in open
    response = self._open(req, data)
/usr/lib/python3.13/urllib/request.py:506: in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
/usr/lib/python3.13/urllib/request.py:466: in _call_chain
    result = func(*args)
/usr/lib/python3.13/urllib/request.py:1367: in https_open
    return self.do_open(http.client.HTTPSConnection, req,
/usr/lib/python3.13/urllib/request.py:1323: in do_open
    r = h.getresponse()
vcr/stubs/__init__.py:277: in getresponse
    self.real_connection.request(
/usr/lib/python3.13/http/client.py:1336: in request
    self._send_request(method, url, body, headers, encode_chunked)
/usr/lib/python3.13/http/client.py:1382: in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
/usr/lib/python3.13/http/client.py:1331: in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
/usr/lib/python3.13/http/client.py:1091: in _send_output
    self.send(msg)
/usr/lib/python3.13/http/client.py:1035: in send
    self.connect()
/usr/lib/python3.13/http/client.py:1477: in connect
    self.sock = self._context.wrap_socket(self.sock,
/usr/lib/python3.13/ssl.py:455: in wrap_socket
    return self.sslsocket_class._create(
/usr/lib/python3.13/ssl.py:1077: in _create
    self.do_handshake()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <ssl.SSLSocket [closed] fd=-1, family=2, type=1, proto=6>, block = False

    @_sslcopydoc
    def do_handshake(self, block=False):
        self._check_connected()
        timeout = self.gettimeout()
        try:
            if timeout == 0.0 and block:
                self.settimeout(None)
>           self._sslobj.do_handshake()
E           ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Missing Authority Key Identifier (_ssl.c:1024)

/usr/lib/python3.13/ssl.py:1363: SSLCertVerificationError
======================================================= short test summary info =======================================================
FAILED tests/integration/test_urllib2.py::test_response_code[https] - ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Missing Authority Key Identifier (_ssl.c...
FAILED tests/integration/test_urllib2.py::test_response_headers[https] - ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Missing Authority Key Identifier (_ssl.c...
FAILED tests/integration/test_urllib2.py::test_get_data[https] - ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Missing Authority Key Identifier (_ssl.c...
FAILED tests/integration/test_urllib2.py::test_post_data[https] - ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Missing Authority Key Identifier (_ssl.c...
FAILED tests/integration/test_urllib2.py::test_post_unicode_data[https] - ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Missing Authority Key Identifier (_ssl.c...
FAILED tests/integration/test_urllib2.py::test_decorator[https] - ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Missing Authority Key Identifier (_ssl.c...
FAILED tests/integration/test_urllib2.py::test_cross_scheme - ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Missing Authority Key Identifier (_ssl.c...
============================================== 7 failed, 7 passed, 4 deselected in 3.50s ==============================================

I wonder if it's a problem with pytest-httpbin perhaps.

@graingert
Copy link
Collaborator

Probably we need to switch to use trustme instead of hard coded certs

@graingert
Copy link
Collaborator

@mgorny I investigated this in pytest-httpbin and there doesn't seem to be a problem there https://github.com/kevin1024/pytest-httpbin/actions/runs/10160156943/job/28095913920?pr=90

@graingert
Copy link
Collaborator

graingert commented Jul 30, 2024

ah seems related to python-trio/trustme#642 and python/cpython#107361

@graingert
Copy link
Collaborator

@mgorny I fixed this in pytest-httpbin kevin1024/pytest-httpbin#90 can you use that branch for now? I don't plan on merging it until downstream PRs are merged: psf/httpbin#51 and python-hyper/brotlicffi#198

@mgorny
Copy link
Contributor Author

mgorny commented Jul 30, 2024

Thanks. I'm just going to continue skipping these tests in Gentoo for now, since I don't really want to carry whole SSL certs in patches.

That said, I wouldn't held my hopes high for httpbin. The project seems pretty much dead again. I'm waiting on psf/httpbin#32 for a long time now.

@graingert
Copy link
Collaborator

@mgorny I've released pytest-httpbin 2.1.0 with the fixes

@mgorny
Copy link
Contributor Author

mgorny commented Sep 18, 2024

Thank you! I can confirm that the new version passes all tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants