Bug 2345532 - python-stack-data fails to build with Python 3.14: test_example: IndexError: list index out of range
Summary: python-stack-data fails to build with Python 3.14: test_example: IndexError: ...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-stack-data
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Lumír Balhar
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.14
TreeView+ depends on / blocked
 
Reported: 2025-02-13 11:53 UTC by Karolina Surma
Modified: 2025-05-28 12:07 UTC (History)
5 users (show)

Fixed In Version: python-stack-data-0.6.3-14.fc43
Clone Of:
Environment:
Last Closed: 2025-05-28 12:07:04 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github alexmojaki stack_data issues 59 0 None open Test failure with Python 3.14 alpha 5 2025-02-14 11:58:47 UTC

Description Karolina Surma 2025-02-13 11:53:26 UTC
python-stack-data fails to build with Python 3.14.05.

_________________________________ test_example _________________________________

capsys = <_pytest.capture.CaptureFixture object at 0x7f909fc3ecf0>

    def test_example(capsys):
        from .samples.formatter_example import bar, print_stack1, format_stack1, format_frame, f_string, blank_lines
    
        @contextmanager
        def check_example(name):
            yield
            stderr = capsys.readouterr().err
            compare_to_file(stderr, name)
    
        with check_example("variables"):
            try:
                bar()
            except Exception:
                MyFormatter(show_variables=True).print_exception()
    
        with check_example("pygmented"):
            try:
                bar()
            except Exception:
                MyFormatter(pygmented=True).print_exception()
    
        with check_example("plain"):
            MyFormatter().set_hook()
            try:
                bar()
            except Exception:
                sys.excepthook(*sys.exc_info())
    
        with check_example("pygmented_error"):
            h = pygments.highlight
            pygments.highlight = lambda *args, **kwargs: 1/0
            try:
                bar()
            except Exception:
                MyFormatter(pygmented=True).print_exception()
            finally:
                pygments.highlight = h
    
        with check_example("print_stack"):
            print_stack1(MyFormatter())
    
        with check_example("format_stack"):
            formatter = MyFormatter()
            formatted = format_stack1(formatter)
            formatter.print_lines(formatted)
    
        with check_example("format_frame"):
            formatter = BaseFormatter()
            formatted = format_frame(formatter)
            formatter.print_lines(formatted)
    
        if sys.version_info[:2] < (3, 8):
            f_string_suffix = 'old'
        elif not fstring_positions_work():
            f_string_suffix = '3.8'
        else:
            f_string_suffix = 'new'
    
        with check_example(f"f_string_{f_string_suffix}"):
            try:
                f_string()
            except Exception:
                MyFormatter().print_exception()
    
        from .samples.formatter_example import block_right, block_left
    
        with check_example(f"block_right_{'old' if sys.version_info[:2] < (3, 8) else 'new'}"):
            try:
                block_right()
            except Exception:
                MyFormatter().print_exception()
    
        with check_example(f"block_left_{'old' if sys.version_info[:2] < (3, 8) else 'new'}"):
            try:
                block_left()
            except Exception:
                MyFormatter().print_exception()
    
        from .samples import cython_example
    
        with check_example("cython_example"):
            try:
                cython_example.foo()
            except Exception:
                MyFormatter().print_exception()
    
>       with check_example("blank_visible"):

tests/test_formatter.py:119: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib64/python3.14/contextlib.py:148: in __exit__
    next(self.gen)
tests/test_formatter.py:40: in check_example
    compare_to_file(stderr, name)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

text = 'Traceback (most recent call last):\n File "formatter_example.py", line 85, in blank_lines\n      79 | def blank_lines...     length = len(a)\n      83 | \n      84 | \n-->   85 |     return a[length]\nIndexError: list index out of range\n'
name = 'blank_visible'

    def compare_to_file(text, name):
        if old_pygments and "pygment" in name:
            return
        filename = os.path.join(
            os.path.dirname(__file__),
            'golden_files',
            name + '.txt',
        )
        if os.environ.get('FIX_STACK_DATA_TESTS'):
            string_to_file(text, filename)
        else:
            expected_output = file_to_string(filename)
>           assert text == expected_output
E           AssertionError

tests/utils.py:26: AssertionError

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

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.14/fedora-rawhide-x86_64/08651107-python-stack-data/

For all our attempts to build python-stack-data with Python 3.14, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.14/package/python-stack-data/

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

Let us know here if you have any questions.

Python 3.14 is planned to be included in Fedora 43.
To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.14.
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 Lumír Balhar 2025-02-14 11:58:47 UTC
Reported upstream. I'm not sure what is wrong here. https://github.com/alexmojaki/stack_data/issues/59


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