Bug 2350304

Summary: Heads-up: python-stack-data fails to build with python-pygments 2.19.1 on Fedora 43
Product: [Fedora] Fedora Reporter: Karolina Surma <ksurma>
Component: python-stack-dataAssignee: Lumír Balhar <lbalhar>
Status: NEW --- QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: epel-packagers-sig, lbalhar, michel
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2322407, 2339432, 2335657    

Description Karolina Surma 2025-03-06 11:33:37 UTC
python-stack-data fails to build with python-pygments 2.19.1 in Fedora 43.
I intend to update python-pygments in Fedora Rawhide in ~1 week.

It was already reported upstream, see:
https://github.com/alexmojaki/stack_data/issues/60

The failure:

_________________________________ test_example _________________________________

    def test_example():
        from .samples.formatter_example import bar, format_frame, format_stack1
    
        result = dict(
            format_frame=(format_frame(MyFormatter())),
            format_stack=format_stack1(MyFormatter(show_variables=True)),
        )
    
        try:
            bar()
        except Exception:
            result.update(
                plain=MyFormatter(show_variables=True).format_exception(),
                pygmented=MyFormatter(show_variables=True, pygmented=True).format_exception(),
                pygmented_html=MyFormatter(show_variables=True, pygmented=True, html=True).format_exception(),
            )
    
    
>       compare_to_file_json(result, "serialize", pygmented=True)

tests/test_serializer.py:42: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

data = {'format_frame': {'filename': 'formatter_example.py', 'lineno': 51, 'lines': [{'is_current': False, 'lineno': 49, 'tex...ormatter_example.py', 'lineno': 8, 'lines': [{...}, {...}, {...}, {...}], 'name': 'foo', ...}, ...], 'tail': ''}], ...}
name = 'serialize'

    def compare_to_file_json(data, name, *, pygmented):
        if old_pygments and pygmented:
            return
        filename = os.path.join(
            os.path.dirname(__file__),
            'golden_files',
            name + '.json',
        )
        if os.environ.get('FIX_STACK_DATA_TESTS'):
            json_to_file(data, filename, indent=4)
        else:
            expected_output = file_to_json(filename)
>           assert data == expected_output
E           AssertionError

The testing takes place in COPR:
https://copr.fedorainfracloud.org/coprs/ksurma/pygments-2.19.1-f43/package/python-stack-data