Bug 2416979 - python-astroid fails to build with Python 3.15: typing.ByteString has been removed from Python, failing TypingBrain.test_typing_object_notsubscriptable_3
Summary: python-astroid fails to build with Python 3.15: typing.ByteString has been re...
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: python-astroid
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Gwyn Ciesla
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.15
TreeView+ depends on / blocked
 
Reported: 2025-11-25 10:11 UTC by Karolina Surma
Modified: 2025-11-25 10:11 UTC (History)
4 users (show)

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


Attachments (Terms of Use)

Description Karolina Surma 2025-11-25 10:11:08 UTC
python-astroid fails to build with Python 3.15.0a2.

______________ TypingBrain.test_typing_object_notsubscriptable_3 _______________

args = (<Attribute.ByteString l.3 at 0x7faa4f0ea530>,)
kwargs = {'context': <astroid.context.InferenceContext object at 0x7faa4f0dd540>}
generator = <generator object Attribute._infer at 0x7faa4f8ebab0>

    def inner(*args: _P.args, **kwargs: _P.kwargs) -> Generator[InferenceResult]:
        generator = func(*args, **kwargs)
        try:
>           yield next(generator)
E           StopIteration

astroid/decorators.py:81: StopIteration

The above exception was the direct cause of the following exception:

self = <tests.brain.test_brain.TypingBrain testMethod=test_typing_object_notsubscriptable_3>

    def test_typing_object_notsubscriptable_3(self):
        """The ByteString class of the typing module is not
        subscriptable (whereas it is in the collections' module)"""
        right_node = builder.extract_node(
            """
        import typing
        typing.ByteString
        """
        )
>       inferred = next(right_node.infer())

tests/brain/test_brain.py:887: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
astroid/nodes/node_ng.py:164: in infer
    for i, result in enumerate(self._infer(context=context, **kwargs)):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

args = (<Attribute.ByteString l.3 at 0x7faa4f0ea530>,)
kwargs = {'context': <astroid.context.InferenceContext object at 0x7faa4f0dd540>}
generator = <generator object Attribute._infer at 0x7faa4f8ebab0>

    def inner(*args: _P.args, **kwargs: _P.kwargs) -> Generator[InferenceResult]:
        generator = func(*args, **kwargs)
        try:
            yield next(generator)
        except StopIteration as error:
            # generator is empty
            if error.args:
                raise InferenceError(**error.args[0]) from error
>           raise InferenceError(
                "StopIteration raised without any error information."
            ) from error
E           astroid.exceptions.InferenceError: StopIteration raised without any error information.

astroid/decorators.py:86: InferenceError
=========================== short test summary info ============================
FAILED tests/brain/test_brain.py::TypingBrain::test_typing_object_notsubscriptable_3
=========== 1 failed, 1736 passed, 76 skipped, 16 xfailed in 16.81s ============

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

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.15/fedora-rawhide-x86_64/09824788-python-astroid/

For all our attempts to build python-astroid with Python 3.15, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.15/package/python-astroid/

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

Let us know here if you have any questions.

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