Bug 2431587

Summary: python-pysdl2 fails to build with Python 3.15: AssertionError: That operation is not supported
Product: [Fedora] Fedora Reporter: Karolina Surma <ksurma>
Component: python-pysdl2Assignee: Sandro <gui1ty>
Status: NEW --- QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: gui1ty, ksurma, mhroncok, neuro-sig
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: 2412434    

Description Karolina Surma 2026-01-21 11:50:16 UTC
python-pysdl2 fails to build with Python 3.15.0a5.

____________________ TestSDLSurface.test_SDL_GetSetClipRect ____________________

self = <sdl2.test.surface_test.TestSDLSurface object at 0x7fbf0227a360>

    def test_SDL_GetSetClipRect(self):
        rectlist = ((rect.SDL_Rect(0, 0, 0, 0), SDL_FALSE, True),
                    (rect.SDL_Rect(2, 2, 0, 0), SDL_FALSE, False),
                    (rect.SDL_Rect(2, 2, 5, 1), SDL_TRUE, True),
                    (rect.SDL_Rect(6, 5, 10, 3), SDL_TRUE, False),
                    (rect.SDL_Rect(0, 0, 10, 10), SDL_TRUE, True),
                    (rect.SDL_Rect(0, 0, -10, 10), SDL_FALSE, False),
                    (rect.SDL_Rect(0, 0, -10, -10), SDL_FALSE, False),
                    (rect.SDL_Rect(-10, -10, 10, 10), SDL_FALSE, False),
                    (rect.SDL_Rect(10, -10, 10, 10), SDL_FALSE, False),
                    (rect.SDL_Rect(10, 10, 10, 10), SDL_TRUE, False)
                    )
    
        clip = rect.SDL_Rect()
        sf = sdl2.SDL_CreateRGBSurface(0, 15, 15, 32, 0, 0, 0, 0)
        assert isinstance(sf.contents, sdl2.SDL_Surface)
        sdl2.SDL_GetClipRect(sf, byref(clip))
        assert clip == rect.SDL_Rect(0, 0, 15, 15)
    
        for r, clipsetval, cmpval in rectlist:
            retval = sdl2.SDL_SetClipRect(sf, r)
            sdl2.SDL_GetClipRect(sf, byref(clip))
            err = "Could not set clip rect %s" % r
            assert retval == clipsetval, "retval: " + err
>           assert (clip == r) == cmpval, "clip: " + err
E           AssertionError: clip: Could not set clip rect SDL_Rect(x=2, y=2, w=0, h=0)
E           assert (SDL_Rect(x=2, y=2, w=0, h=0) == SDL_Rect(x=2, y=2, w=0, h=0)
E             
E             Use -v to get more diff) == False

sdl2/test/surface_test.py:493: AssertionError
________________________ test_SDL_GetSetWindowMouseRect ________________________

with_sdl = None

    @pytest.mark.skipif(sdl2.dll.version < 2018, reason="not available")
    def test_SDL_GetSetWindowMouseRect(with_sdl):
        flags = sdl2.SDL_WINDOW_BORDERLESS
        bounds_in = rect.SDL_Rect(0, 0, 100, 50)
        window = _create_window(b"Test", 200, 200, 200, 200, flags)
        # Try setting a mouse boundary
        ret = sdl2.SDL_SetWindowMouseRect(window, byref(bounds_in))
>       assert ret == 0, _check_error_msg()
E       AssertionError: That operation is not supported
E       assert -1 == 0


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/10038632-python-pysdl2/

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

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.