With this PR: https://src.fedoraproject.org/rpms/ansible-core/pull-request/9 We see the following test failures with Python 3.11 in the f37-python side tag: =================================== FAILURES =================================== ______________________ test_redir_http_error_308_urllib2 _______________________ [gw5] linux -- Python 3.11.0 /usr/bin/python3 urllib_req = <urllib.request.Request object at 0xf47b1130> request_body = <_io.StringIO object at 0xf53bd220> def test_redir_http_error_308_urllib2(urllib_req, request_body): handler = RedirectHandlerFactory('urllib2', False) inst = handler() > with pytest.raises(urllib_error.HTTPError): E Failed: DID NOT RAISE <class 'urllib.error.HTTPError'> test/units/module_utils/urls/test_RedirectHandlerFactory.py:137: Failed ____________________________ test_fetch_url_cookies ____________________________ [gw4] linux -- Python 3.11.0 /usr/bin/python3 mocker = <function test_fetch_url_cookies.<locals>.make_cookies at 0xf47fc8e8> fake_ansible_module = <units.module_utils.urls.test_fetch_url.FakeAnsibleModule object at 0xf4850070> def test_fetch_url_cookies(mocker, fake_ansible_module): def make_cookies(*args, **kwargs): cookies = kwargs['cookies'] r = MagicMock() try: r.headers = HTTPMessage() add_header = r.headers.add_header except TypeError: # PY2 r.headers = HTTPMessage(StringIO()) add_header = r.headers.addheader r.info.return_value = r.headers for name, value in (('Foo', 'bar'), ('Baz', 'qux')): cookie = Cookie( version=0, name=name, value=value, port=None, port_specified=False, domain="ansible.com", domain_specified=True, domain_initial_dot=False, path="/", path_specified=True, secure=False, expires=None, discard=False, comment=None, comment_url=None, rest=None ) cookies.set_cookie(cookie) add_header('Set-Cookie', '%s=%s' % (name, value)) return r mocker = mocker.patch('ansible.module_utils.urls.open_url', new=make_cookies) r, info = fetch_url(fake_ansible_module, 'http://ansible.com/') assert info['cookies'] == {'Baz': 'qux', 'Foo': 'bar'} # Python sorts cookies in order of most specific (ie. longest) path first # items with the same path are reversed from response order > assert info['cookies_string'] == 'Baz=qux; Foo=bar' E AssertionError: assert 'Foo=bar; Baz=qux' == 'Baz=qux; Foo=bar' E - Baz=qux; Foo=bar E + Foo=bar; Baz=qux test/units/module_utils/urls/test_fetch_url.py:138: AssertionError - generated xml file: /builddir/build/BUILD/ansible-core-2.12.6/test/results/junit/python3.11-module_utils-units.xml - Hence, we cannot rebuild ansible for Python 3.11.
test_fetch_url_cookies seems like a bad order issue, I suggest we can skip the test for now.
The first test is fixed in https://github.com/ansible/ansible/commit/0ef5274a3c6189e8fa6a7d97993c165ab548fe95 The second in https://github.com/ansible/ansible/commit/8ca28acd0d121c778aa540c1d61f58f5ae2d5dcc