Bug 2584217 - python-botocore fails to build with Python 3.16: ValueError: Port could not be cast to integer value as 'ec2:0000:0000:0000:0000:0000:0000' / AssertionErrors
Summary: python-botocore fails to build with Python 3.16: ValueError: Port could not b...
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: python-botocore
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: David Duncan
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.16
TreeView+ depends on / blocked
 
Reported: 2026-11-25 15:33 UTC by Karolina Surma
Modified: 2026-11-25 15:33 UTC (History)
6 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Karolina Surma 2026-11-25 15:33:06 UTC
python-botocore fails to build with Python 3.16.0a2.

______________ TestInstanceMetadataFetcher.test_metadata_endpoint ______________
[gw1] linux -- Python 3.16.0 /usr/bin/python3

self = <tests.unit.test_utils.TestInstanceMetadataFetcher testMethod=test_metadata_endpoint>

    def test_metadata_endpoint(self):
        urls = [
            'http://fd00:ec2:0000:0000:0000:0000:0000:0000/',
            'http://[fd00:ec2::010]/',
            'http://192.168.1.1/',
        ]
        for url in urls:
>           self.assertTrue(is_valid_uri(url))
                            ^^^^^^^^^^^^^^^^^

tests/unit/test_utils.py:3054: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
botocore/utils.py:1344: in is_valid_uri
    return is_valid_endpoint_url(endpoint_url) or is_valid_ipv6_endpoint_url(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
botocore/utils.py:1328: in is_valid_endpoint_url
    parts = urlsplit(endpoint_url)
            ^^^^^^^^^^^^^^^^^^^^^^
/usr/lib64/python3.16/urllib/parse.py:604: in urlsplit
    scheme, netloc, url, query, fragment = _urlsplit(url, scheme, allow_fragments)
                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib64/python3.16/urllib/parse.py:646: in _urlsplit
    _checknetloc(netloc)
/usr/lib64/python3.16/urllib/parse.py:547: in _checknetloc
    _validate_port(port)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

port = 'ec2:0000:0000:0000:0000:0000:0000'

    def _validate_port(port):
        if port.isdigit() and port.isascii():
            port = int(port)
        else:
>           raise ValueError(f"Port could not be cast to integer value as {port!r}")
E           ValueError: Port could not be cast to integer value as 'ec2:0000:0000:0000:0000:0000:0000'

/usr/lib64/python3.16/urllib/parse.py:166: ValueError
_______________ TestCreateWaiter.test_waiter_help_documentation ________________
[gw1] linux -- Python 3.16.0 /usr/bin/python3

self = <tests.unit.test_waiters.TestCreateWaiter testMethod=test_waiter_help_documentation>

    def test_waiter_help_documentation(self):
        waiter_name = 'WaiterName'
        waiter = create_waiter_with_client(
            waiter_name, self.waiter_model, self.client
        )
        with mock.patch('sys.stdout', io.StringIO()) as mock_stdout:
            help(waiter.wait)
        content = mock_stdout.getvalue()
        lines = [
            (
                '    Polls :py:meth:`MyService.Client.foo` every 1 '
                'seconds until a successful state is reached. An error '
                'is raised after 1 failed checks.'
            ),
            '    **Request Syntax**',
            '    ::',
            '      waiter.wait(',
            "          bar='string'",
            '      )',
            '    :type bar: string',
            '    :param bar: Documents bar',
            '    :returns: None',
        ]
        for line in lines:
>           self.assertIn(line, content)
E           AssertionError: '    Polls :py:meth:`MyService.Client.foo` every 1 seconds until a successful state is reached. An error is raised after 1 failed checks.' not found in "Help on method wait in module botocore.waiter:\n\nwait(**kwargs) method of botocore.waiter.MyService.Waiter.WaiterName instance\n    Polls :py:meth:`MyService.Client.foo` every 1 seconds until a\n    successful state is reached. An error is raised after 1 failed\n    checks.\n\n    **Request Syntax**\n    ::\n\n      waiter.wait(\n          bar='string',\n          WaiterConfig={\n              'Delay': 123,\n              'MaxAttempts': 123\n          }\n      )\n\n    :type bar: string\n    :param bar: Documents bar\n\n\n    :type WaiterConfig: dict\n    :param WaiterConfig:\n\n      A dictionary that provides parameters to control waiting behavior.\n\n\n\n\n      - **Delay** *(integer) --*\n\n        The amount of time in seconds to wait between attempts. Default: 1\n\n\n\n\n      - **MaxAttempts** *(integer) --*\n\n        The maximum number of attempts to be made. Default: 1\n\n\n\n\n\n\n    :returns: None\n\n"

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

urllib.parse.urlsplit() and urllib.parse.urlparse() now raise ValueError when the URL is parsed if the port is not a decimal number or is outside the range 0–65535. Previously, the error was only raised when the port attribute was read. This also affects urljoin(), and urldefrag() for URLs with a fragment. Code which never read port may now fail on URLs such as:

    SCP-style addresses given a scheme, such as git+ssh://git:org/repo.git;

    multi-host URLs with ports, such as mongodb://h1:27017,h2:27017/db or postgresql://h1:5432,h2:5433/db;

    URL templates with a placeholder port, such as http://localhost:{port}/.

These are not valid URLs under RFC 3986. To process them, split off the netloc yourself before calling urlsplit(), for example by replacing it with a placeholder host, or fill in templates before parsing them. (Contributed by Miguel Brito and Senthil Kumaran in gh-88037.)

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.16/fedora-rawhide-x86_64/11359633-python-botocore/

For all our attempts to build python-botocore with Python 3.16, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.16/package/python-botocore/

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.16:
https://copr.fedorainfracloud.org/coprs/g/python/python3.16/

Let us know here if you have any questions.

Python 3.16 is planned to be included in Fedora 47.
To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.16.
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.


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