Bug 2203773 - python-urllib3 fails to build with Python 3.12: AssertionError: assert <class 'NoneType'> == list
Summary: python-urllib3 fails to build with Python 3.12: AssertionError: assert <class...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: python-urllib3
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
Assignee: Fedora Infrastructure SIG
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.12
TreeView+ depends on / blocked
 
Reported: 2023-05-15 08:35 UTC by Tomáš Hrnčiar
Modified: 2023-05-16 17:21 UTC (History)
7 users (show)

Fixed In Version: python-urllib3-1.26.12-3.fc39
Clone Of:
Environment:
Last Closed: 2023-05-16 17:21:14 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Tomáš Hrnčiar 2023-05-15 08:35:09 UTC
python-urllib3 fails to build with Python 3.12.0a7.

=================================== FAILURES ===================================
______________ SingleTLSLayerTestCase.test_ssl_object_attributes _______________

self = <test.test_ssltransport.SingleTLSLayerTestCase object at 0x7f88718bf020>

    @pytest.mark.timeout(PER_TEST_TIMEOUT)
    def test_ssl_object_attributes(self):
        """Ensures common ssl attributes are exposed"""
        self.start_dummy_server()
    
        sock = socket.create_connection((self.host, self.port))
        with SSLTransport(
            sock, self.client_context, server_hostname="localhost"
        ) as ssock:
            cipher = ssock.cipher()
            assert type(cipher) == tuple
    
            # No chosen protocol through ALPN or NPN.
            assert ssock.selected_alpn_protocol() is None
            assert ssock.selected_npn_protocol() is None
    
            shared_ciphers = ssock.shared_ciphers()
>           assert type(shared_ciphers) == list
E           AssertionError: assert <class 'NoneType'> == list
E            +  where <class 'NoneType'> = type(None)

test/test_ssltransport.py:205: AssertionError

=========================== short test summary info ============================
FAILED test/test_ssltransport.py::SingleTLSLayerTestCase::test_ssl_object_attributes
=========== 1 failed, 721 passed, 8 skipped, 1572 warnings in 16.50s ===========

https://docs.python.org/3.12/whatsnew/3.12.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.12/fedora-rawhide-x86_64/05918287-python-urllib3/

For all our attempts to build python-urllib3 with Python 3.12, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.12/package/python-urllib3/

Testing and mass rebuild of packages is happening in copr. You can follow these instructions to test locally in mock if your package builds with Python 3.12:
https://copr.fedorainfracloud.org/coprs/g/python/python3.12/

Let us know here if you have any questions.

Python 3.12 is planned to be included in Fedora 39. To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.12.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires), so if this package is required a lot, it's important for us to get it fixed soon.
We'd appreciate help from the people who know this package best, but if you don't want to work on this now, let us know so we can try to work around it on our side.

Comment 1 Miro Hrončok 2023-05-15 08:50:46 UTC
This is a very important package in the Python stack, hence setting severity to high.

Comment 2 Kevin Fenzi 2023-05-15 17:31:41 UTC
Related: https://github.com/urllib3/urllib3/pull/2959

May be fixed in newer upstream releases?

Comment 3 Miro Hrončok 2023-05-16 08:48:30 UTC
I'd be relatively slow with updating this to version 2. Two releases were already yanked from PyPI. Backporting might be safer, if possible.

Comment 4 Tomáš Hrnčiar 2023-05-16 09:57:43 UTC
Also, there are *a lot* changes in version 2. https://github.com/urllib3/urllib3/blob/main/CHANGES.rst

(In reply to Kevin Fenzi from comment #2)
> Related: https://github.com/urllib3/urllib3/pull/2959
> 

Thank you for the link, with this commit the build succeeded.

Comment 5 Tomáš Hrnčiar 2023-05-16 10:17:56 UTC
PR: https://bugzilla.redhat.com/show_bug.cgi?id=2203773

Comment 6 Tomáš Hrnčiar 2023-05-16 10:19:55 UTC
oops, wrong paste

https://src.fedoraproject.org/rpms/python-urllib3/pull-request/19

Comment 7 Fedora Update System 2023-05-16 17:19:39 UTC
FEDORA-2023-7466f8fa74 has been submitted as an update to Fedora 39. https://bodhi.fedoraproject.org/updates/FEDORA-2023-7466f8fa74

Comment 8 Fedora Update System 2023-05-16 17:21:14 UTC
FEDORA-2023-7466f8fa74 has been pushed to the Fedora 39 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.