Bug 2339020 - python-pysdl2: FTBFS in Fedora Rawhide
Summary: python-pysdl2: FTBFS in Fedora Rawhide
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: python-pysdl2
Version: 42
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Sandro
QA Contact:
URL: https://koschei.fedoraproject.org/pac...
Whiteboard:
: 2341200 (view as bug list)
Depends On:
Blocks: F42FTBFS 2335933
TreeView+ depends on / blocked
 
Reported: 2025-01-20 16:36 UTC by Sandro
Modified: 2025-05-12 01:56 UTC (History)
6 users (show)

Fixed In Version: python-pysdl2-0.9.17-3.fc43 python-pysdl2-0.9.17-3.fc42
Clone Of:
Environment:
Last Closed: 2025-05-11 10:23:10 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
core dump from local test build (8.92 MB, application/octet-stream)
2025-01-20 16:49 UTC, Sandro
no flags Details

Description Sandro 2025-01-20 16:36:02 UTC
Description of problem:
Package python-pysdl2 fails to build from source in Fedora Rawhide.

Version-Release number of selected component (if applicable):
0.9.17-1.fc42

Steps to Reproduce:
koji build --scratch f42 python-pysdl2-0.9.17-1.fc42.src.rpm

Additional info:
This package is tracked by Koschei. See:
https://koschei.fedoraproject.org/package/python-pysdl2

Reproducible: Always

Comment 1 Sandro 2025-01-20 16:46:35 UTC
Package builds started to fail with the switch to sdl2-compat [1]. At first it was one test failing with a 'Floating-point exception' dumping core [2]. However excluding that test, more tests appear to fail, though they do not exit abnormally.

My knowledge of those libraries, and C/C++ / ctypes in general, is limited. I would appreciate some help in analyzing and possibly fixing the issue. Right now it appears PySDL2 is not compatible with sdl2-compat.

[1] https://fedoraproject.org/wiki/Releases/42/ChangeSet#Replace_SDL_2_with_sdl2-compat_using_SDL_3
[2] https://koschei.fedoraproject.org/build/19479574

Comment 2 Sandro 2025-01-20 16:49:44 UTC
Created attachment 2066809 [details]
core dump from local test build

Backtrace for attached coredump:

#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=8, no_tid=no_tid@entry=0) at pthread_kill.c:44
#1  0x00007f2bddc7ff53 in __pthread_kill_internal (threadid=<optimized out>, signo=8) at pthread_kill.c:89
#2  0x00007f2bddc264de in __GI_raise (sig=8) at ../sysdeps/posix/raise.c:26
#3  <signal handler called>
#4  0x00007f2bdc8815f2 in UpdateLogicalPresentation.part.0.lto_priv.0 (renderer=0x559bb87edf10) at /usr/src/debug/SDL3-3.1.10-1.fc42.x86_64/src/render/SDL_render.c:2579
#5  0x00007f2bdc86f0f5 in UpdateLogicalPresentation (renderer=0x559bb87edf10) at /usr/src/debug/SDL3-3.1.10-1.fc42.x86_64/src/render/SDL_render.c:2549
#6  SDL_SetRenderLogicalPresentation_REAL (renderer=0x559bb87edf10, w=0, h=0, mode=<optimized out>) at /usr/src/debug/SDL3-3.1.10-1.fc42.x86_64/src/render/SDL_render.c:2660
#7  0x00007f2bdcc11e18 in SDL_RenderSetIntegerScale_REAL (renderer=0x559bb87edf10, enable=SDL2_TRUE) at /usr/src/debug/sdl2-compat-2.30.50~git20250119.1126.208cea9-1.fc42.x86_64/src/sdl2_compat.c:4565
#8  0x00007f2bdcc66056 in ffi_call_unix64 () at ../src/x86/unix64.S:104
#9  0x00007f2bdcc6174d in ffi_call_int (cif=cif@entry=0x7ffc74778010, fn=<optimized out>, rvalue=<optimized out>, avalue=<optimized out>, closure=closure@entry=0x0) at ../src/x86/ffi64.c:673
#10 0x00007f2bdcc6464e in ffi_call (cif=cif@entry=0x7ffc74778010, fn=fn@entry=0x7f2bdcc2b700 <SDL_RenderSetIntegerScale>, rvalue=rvalue@entry=0x7ffc74777f40, avalue=avalue@entry=0x7ffc74777f20) at ../src/x86/ffi64.c:710
#11 0x00007f2bdcc7fec8 in _call_function_pointer (st=0x7f2bdcf67df0, flags=<optimized out>, pProc=0x7f2bdcc2b700 <SDL_RenderSetIntegerScale>, avalues=0x7ffc74777f20, atypes=<optimized out>, restype=<optimized out>, resmem=0x7ffc74777f40, argcount=2, 
    argtypecount=<optimized out>) at /usr/src/debug/python3.13-3.13.1-2.fc42.x86_64/Modules/_ctypes/callproc.c:950
#12 _ctypes_callproc (st=<optimized out>, pProc=<optimized out>, argtuple=argtuple@entry=0x7f2bd928ddc0, flags=<optimized out>, argtypes=<optimized out>, restype=<optimized out>, checker=<optimized out>)
    at /usr/src/debug/python3.13-3.13.1-2.fc42.x86_64/Modules/_ctypes/callproc.c:1300
#13 0x00007f2bdcc7df3d in PyCFuncPtr_call (self=<optimized out>, inargs=<optimized out>, kwds=0x0) at /usr/src/debug/python3.13-3.13.1-2.fc42.x86_64/Modules/_ctypes/_ctypes.c:4386
#14 0x00007f2bddf3894b in _PyObject_MakeTpCall (tstate=0x7f2bde33a870 <_PyRuntime+283024>, callable=0x7f2bdcbdb290, args=<optimized out>, nargs=2, keywords=0x0) at /usr/src/debug/python3.13-3.13.1-2.fc42.x86_64/Objects/call.c:242
#15 0x00007f2bddf51a32 in _PyEval_EvalFrameDefault (tstate=<optimized out>, frame=<optimized out>, throwflag=<optimized out>) at /usr/src/debug/python3.13-3.13.1-2.fc42.x86_64/Python/generated_cases.c.h:813
#16 0x00007f2bde01959e in _PyObject_VectorcallDictTstate (tstate=0x7f2bde33a870 <_PyRuntime+283024>, callable=0x7f2bdd5e3920, args=<optimized out>, nargsf=<optimized out>, kwargs=<optimized out>) at /usr/src/debug/python3.13-3.13.1-2.fc42.x86_64/Objects/call.c:146
#17 0x00007f2bde0718f7 in _PyObject_Call_Prepend (tstate=0x7f2bde33a870 <_PyRuntime+283024>, callable=0x7f2bdd5e3920, obj=<optimized out>, args=0x7f2bde30afc8 <_PyRuntime+88296>, kwargs=0x7f2bd9066e40) at /usr/src/debug/python3.13-3.13.1-2.fc42.x86_64/Objects/call.c:504
#18 slot_tp_call (self=<optimized out>, args=0x7f2bde30afc8 <_PyRuntime+88296>, kwds=0x7f2bd9066e40) at /usr/src/debug/python3.13-3.13.1-2.fc42.x86_64/Objects/typeobject.c:9533
#19 0x00007f2bddf3894b in _PyObject_MakeTpCall (tstate=0x7f2bde33a870 <_PyRuntime+283024>, callable=0x7f2bdceb5fd0, args=<optimized out>, nargs=0, keywords=0x7f2bdd010d60) at /usr/src/debug/python3.13-3.13.1-2.fc42.x86_64/Objects/call.c:242
#20 0x00007f2bddf57d17 in _PyEval_EvalFrameDefault (tstate=<optimized out>, frame=<optimized out>, throwflag=<optimized out>) at /usr/src/debug/python3.13-3.13.1-2.fc42.x86_64/Python/generated_cases.c.h:1502
#21 0x00007f2bde01959e in _PyObject_VectorcallDictTstate (tstate=0x7f2bde33a870 <_PyRuntime+283024>, callable=0x7f2bdd5e3920, args=<optimized out>, nargsf=<optimized out>, kwargs=<optimized out>) at /usr/src/debug/python3.13-3.13.1-2.fc42.x86_64/Objects/call.c:146
#22 0x00007f2bde0718f7 in _PyObject_Call_Prepend (tstate=0x7f2bde33a870 <_PyRuntime+283024>, callable=0x7f2bdd5e3920, obj=<optimized out>, args=0x7f2bde30afc8 <_PyRuntime+88296>, kwargs=0x7f2bd96e1740) at /usr/src/debug/python3.13-3.13.1-2.fc42.x86_64/Objects/call.c:504
#23 slot_tp_call (self=<optimized out>, args=0x7f2bde30afc8 <_PyRuntime+88296>, kwds=0x7f2bd96e1740) at /usr/src/debug/python3.13-3.13.1-2.fc42.x86_64/Objects/typeobject.c:9533
#24 0x00007f2bde028386 in _PyObject_Call (tstate=0x7f2bde33a870 <_PyRuntime+283024>, callable=0x7f2bdceb61b0, args=0x7f2bde30afc8 <_PyRuntime+88296>, kwargs=<optimized out>) at /usr/src/debug/python3.13-3.13.1-2.fc42.x86_64/Objects/call.c:361
#25 0x00007f2bddf5331d in PyObject_Call (callable=0x7f2bdceb61b0, args=0x7f2bde30afc8 <_PyRuntime+88296>, kwargs=0x7f2bd96e1740) at /usr/src/debug/python3.13-3.13.1-2.fc42.x86_64/Objects/call.c:373
#26 PyCFunction_Call (callable=0x7f2bdceb61b0, args=0x7f2bde30afc8 <_PyRuntime+88296>, kwargs=0x7f2bd96e1740) at /usr/src/debug/python3.13-3.13.1-2.fc42.x86_64/Objects/call.c:381
--Type <RET> for more, q to quit, c to continue without paging--c
#27 _PyEval_EvalFrameDefault (tstate=<optimized out>, frame=<optimized out>, throwflag=<optimized out>) at /usr/src/debug/python3.13-3.13.1-2.fc42.x86_64/Python/generated_cases.c.h:1355
#28 0x00007f2bde01959e in _PyObject_VectorcallDictTstate (tstate=0x7f2bde33a870 <_PyRuntime+283024>, callable=0x7f2bdd5e3920, args=<optimized out>, nargsf=<optimized out>, kwargs=<optimized out>) at /usr/src/debug/python3.13-3.13.1-2.fc42.x86_64/Objects/call.c:146
#29 0x00007f2bde0718f7 in _PyObject_Call_Prepend (tstate=0x7f2bde33a870 <_PyRuntime+283024>, callable=0x7f2bdd5e3920, obj=<optimized out>, args=0x7f2bde30afc8 <_PyRuntime+88296>, kwargs=0x7f2bd9bb7b00) at /usr/src/debug/python3.13-3.13.1-2.fc42.x86_64/Objects/call.c:504
#30 slot_tp_call (self=<optimized out>, args=0x7f2bde30afc8 <_PyRuntime+88296>, kwds=0x7f2bd9bb7b00) at /usr/src/debug/python3.13-3.13.1-2.fc42.x86_64/Objects/typeobject.c:9533
#31 0x00007f2bddf3894b in _PyObject_MakeTpCall (tstate=0x7f2bde33a870 <_PyRuntime+283024>, callable=0x7f2bdceb6340, args=<optimized out>, nargs=0, keywords=0x7f2bdd282980) at /usr/src/debug/python3.13-3.13.1-2.fc42.x86_64/Objects/call.c:242
#32 0x00007f2bddf57d17 in _PyEval_EvalFrameDefault (tstate=<optimized out>, frame=<optimized out>, throwflag=<optimized out>) at /usr/src/debug/python3.13-3.13.1-2.fc42.x86_64/Python/generated_cases.c.h:1502
#33 0x00007f2bde01959e in _PyObject_VectorcallDictTstate (tstate=0x7f2bde33a870 <_PyRuntime+283024>, callable=0x7f2bdd5e3920, args=<optimized out>, nargsf=<optimized out>, kwargs=<optimized out>) at /usr/src/debug/python3.13-3.13.1-2.fc42.x86_64/Objects/call.c:146
#34 0x00007f2bde0718f7 in _PyObject_Call_Prepend (tstate=0x7f2bde33a870 <_PyRuntime+283024>, callable=0x7f2bdd5e3920, obj=<optimized out>, args=0x7f2bde30afc8 <_PyRuntime+88296>, kwargs=0x7f2bdcd4d680) at /usr/src/debug/python3.13-3.13.1-2.fc42.x86_64/Objects/call.c:504
#35 slot_tp_call (self=<optimized out>, args=0x7f2bde30afc8 <_PyRuntime+88296>, kwds=0x7f2bdcd4d680) at /usr/src/debug/python3.13-3.13.1-2.fc42.x86_64/Objects/typeobject.c:9533
#36 0x00007f2bddf3894b in _PyObject_MakeTpCall (tstate=0x7f2bde33a870 <_PyRuntime+283024>, callable=0x7f2bdceb6430, args=<optimized out>, nargs=0, keywords=0x7f2bdd3f1150) at /usr/src/debug/python3.13-3.13.1-2.fc42.x86_64/Objects/call.c:242
#37 0x00007f2bddf57d17 in _PyEval_EvalFrameDefault (tstate=<optimized out>, frame=<optimized out>, throwflag=<optimized out>) at /usr/src/debug/python3.13-3.13.1-2.fc42.x86_64/Python/generated_cases.c.h:1502
#38 0x00007f2bde01959e in _PyObject_VectorcallDictTstate (tstate=0x7f2bde33a870 <_PyRuntime+283024>, callable=0x7f2bdd5e3920, args=<optimized out>, nargsf=<optimized out>, kwargs=<optimized out>) at /usr/src/debug/python3.13-3.13.1-2.fc42.x86_64/Objects/call.c:146
#39 0x00007f2bde0718f7 in _PyObject_Call_Prepend (tstate=0x7f2bde33a870 <_PyRuntime+283024>, callable=0x7f2bdd5e3920, obj=<optimized out>, args=0x7f2bde30afc8 <_PyRuntime+88296>, kwargs=0x7f2bdcd51040) at /usr/src/debug/python3.13-3.13.1-2.fc42.x86_64/Objects/call.c:504
#40 slot_tp_call (self=<optimized out>, args=0x7f2bde30afc8 <_PyRuntime+88296>, kwds=0x7f2bdcd51040) at /usr/src/debug/python3.13-3.13.1-2.fc42.x86_64/Objects/typeobject.c:9533
#41 0x00007f2bddf3894b in _PyObject_MakeTpCall (tstate=0x7f2bde33a870 <_PyRuntime+283024>, callable=0x7f2bdceb5670, args=<optimized out>, nargs=0, keywords=0x7f2bdd3f17e0) at /usr/src/debug/python3.13-3.13.1-2.fc42.x86_64/Objects/call.c:242
#42 0x00007f2bddf57d17 in _PyEval_EvalFrameDefault (tstate=<optimized out>, frame=<optimized out>, throwflag=<optimized out>) at /usr/src/debug/python3.13-3.13.1-2.fc42.x86_64/Python/generated_cases.c.h:1502
#43 0x00007f2bde01b72b in PyEval_EvalCode (co=0x7f2bddaa1530, globals=<optimized out>, locals=0x7f2bdd94cc40) at /usr/src/debug/python3.13-3.13.1-2.fc42.x86_64/Python/ceval.c:601
#44 0x00007f2bde03de90 in run_eval_code_obj (tstate=tstate@entry=0x7f2bde33a870 <_PyRuntime+283024>, co=co@entry=0x7f2bddaa1530, globals=globals@entry=0x7f2bdd94cc40, locals=locals@entry=0x7f2bdd94cc40)
    at /usr/src/debug/python3.13-3.13.1-2.fc42.x86_64/Python/pythonrun.c:1337
#45 0x00007f2bde038733 in run_mod (mod=mod@entry=0x559bb80aa588, filename=filename@entry=0x7f2bdd94cd70, globals=globals@entry=0x7f2bdd94cc40, locals=locals@entry=0x7f2bdd94cc40, flags=flags@entry=0x7ffc74779628, arena=arena@entry=0x7f2bdda37dd0, interactive_src=0x0, 
    generate_new_source=0) at /usr/src/debug/python3.13-3.13.1-2.fc42.x86_64/Python/pythonrun.c:1422
#46 0x00007f2bde059986 in pyrun_file (fp=fp@entry=0x559bb8016370, filename=filename@entry=0x7f2bdd94cd70, start=start@entry=257, globals=globals@entry=0x7f2bdd94cc40, locals=locals@entry=0x7f2bdd94cc40, closeit=closeit@entry=1, flags=0x7ffc74779628)
    at /usr/src/debug/python3.13-3.13.1-2.fc42.x86_64/Python/pythonrun.c:1255
#47 0x00007f2bde05903f in _PyRun_SimpleFileObject (fp=fp@entry=0x559bb8016370, filename=filename@entry=0x7f2bdd94cd70, closeit=closeit@entry=1, flags=flags@entry=0x7ffc74779628) at /usr/src/debug/python3.13-3.13.1-2.fc42.x86_64/Python/pythonrun.c:490
#48 0x00007f2bde058e61 in _PyRun_AnyFileObject (fp=fp@entry=0x559bb8016370, filename=filename@entry=0x7f2bdd94cd70, closeit=closeit@entry=1, flags=flags@entry=0x7ffc74779628) at /usr/src/debug/python3.13-3.13.1-2.fc42.x86_64/Python/pythonrun.c:77
#49 0x00007f2bde051468 in pymain_run_file_obj (program_name=0x7f2bdd94cdb0, filename=0x7f2bdd94cd70, skip_source_first_line=0) at /usr/src/debug/python3.13-3.13.1-2.fc42.x86_64/Modules/main.c:409
#50 pymain_run_file (config=0x7f2bde30cf68 <_PyRuntime+96392>) at /usr/src/debug/python3.13-3.13.1-2.fc42.x86_64/Modules/main.c:428
#51 pymain_run_python (exitcode=0x7ffc7477961c) at /usr/src/debug/python3.13-3.13.1-2.fc42.x86_64/Modules/main.c:696
#52 Py_RunMain () at /usr/src/debug/python3.13-3.13.1-2.fc42.x86_64/Modules/main.c:775
#53 0x00007f2bde00ab1c in Py_BytesMain (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/python3.13-3.13.1-2.fc42.x86_64/Modules/main.c:829
#54 0x00007f2bddc10048 in __libc_start_call_main (main=main@entry=0x559bb016c160 <main>, argc=argc@entry=6, argv=argv@entry=0x7ffc74779888) at ../sysdeps/nptl/libc_start_call_main.h:58
#55 0x00007f2bddc1010b in __libc_start_main_impl (main=0x559bb016c160 <main>, argc=6, argv=0x7ffc74779888, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffc74779878) at ../csu/libc-start.c:360
#56 0x0000559bb016c095 in _start ()

Comment 3 Sandro 2025-01-20 16:51:08 UTC
Other tests failing without dumping core:

=================================== FAILURES ===================================
________________________ test_SDL_GetCurrentAudioDriver ________________________
with_sdl_audio = None
    def test_SDL_GetCurrentAudioDriver(with_sdl_audio):
        success = 0
        # Reset audio subsystem
        SDL_Quit()
        SDL_Init(0)
        for index in range(sdl2.SDL_GetNumAudioDrivers()):
            drivername = sdl2.SDL_GetAudioDriver(index)
            os.environ["SDL_AUDIODRIVER"] = drivername.decode("utf-8")
            # Certain drivers fail without bringing up the correct
            # return value, such as the esd, if it is not running.
            SDL_InitSubSystem(SDL_INIT_AUDIO)
            driver = sdl2.SDL_GetCurrentAudioDriver()
            SDL_QuitSubSystem(SDL_INIT_AUDIO)
            # Do not handle wrong return values.
            if driver is not None:
>               assert drivername == driver
E               AssertionError: assert b'pipewire' == b'dummy'
E                 
E                 At index 0 diff: b'p' != b'd'
E                 
E                 Full diff:
E                 - (b'dummy')
E                 + (b'pipewire')
sdl2/test/audio_test.py:218: AssertionError
_________________________ test_SDL_GetDefaultAudioInfo _________________________
with_default_driver = b'dummy'
    @pytest.mark.skipif(sdl2.dll.version < 2240, reason="not available")
    def test_SDL_GetDefaultAudioInfo(with_default_driver):
        driver = with_default_driver
        drivername = driver.decode('utf-8')
        # Get name and spec of first output device
        outspec = sdl2.SDL_AudioSpec(0, 0, 0, 0)
        outname = ctypes.c_char_p()
        ret = sdl2.SDL_GetDefaultAudioInfo(ctypes.byref(outname), ctypes.byref(outspec), 0)
        # If method isn't implemented for the current back end, just skip
        if ret < 0 and b"not supported" in sdl2.SDL_GetError():
            pytest.skip("not supported by driver")
>       assert ret == 0, _check_error_msg()
E       AssertionError: 
E       assert 1 == 0
sdl2/test/audio_test.py:311: AssertionError
_______________________________ test_SDL_SetHint _______________________________
with_sdl = None
    def test_SDL_SetHint(with_sdl):
        assert sdl2.SDL_SetHint(b"TEST", b"32") == 1
        assert sdl2.SDL_GetHint(b"TEST") == b"32"
        assert sdl2.SDL_SetHint(b"TEST", b"abcdef") == 1
        assert sdl2.SDL_GetHint(b"TEST") == b"abcdef"
>       assert sdl2.SDL_SetHint(b"", b"hi") == 1
E       AssertionError: assert 0 == 1
E        +  where 0 = <_FuncPtr object at 0x7f4113bc3350>(b'', b'hi')
E        +    where <_FuncPtr object at 0x7f4113bc3350> = sdl2.SDL_SetHint
sdl2/test/hints_test.py:35: AssertionError
_________________________ test_SDL_AddDelHintCallback __________________________
with_sdl = None
    def test_SDL_AddDelHintCallback(with_sdl):
        topmost_hint = sdl2.SDL_HINT_ALLOW_TOPMOST
        calls = []
        def callback(userdata, name, oldval, newval):
            data = cast(userdata, c_char_p)
            calls.append((data.value, name, oldval, newval))
        hintcb = sdl2.SDL_HintCallback(callback)
        udata = c_char_p(b"banana")
        sdl2.SDL_AddHintCallback(topmost_hint, hintcb, udata)
        # SDL_AddHintCallback invokes the callback once.
        assert len(calls) == 1
>       assert calls[0] == (b"banana", topmost_hint, None, None)
E       AssertionError: assert (b'banana', b...', None, None) == (b'banana', b...', None, None)
E         
E         At index 1 diff: b'SDL_WINDOW_ALLOW_TOPMOST' != b'SDL_ALLOW_TOPMOST'
E         
E         Full diff:
E           (
E               b'banana',
E         -     b'SDL_ALLOW_TOPMOST',...
E         
E         ...Full output truncated (5 lines hidden), use '-vv' to show
sdl2/test/hints_test.py:67: AssertionError
_________________________ test_SDL_StartStopTextInput __________________________
with_sdl = None
    def test_SDL_StartStopTextInput(with_sdl):
        sdl2.SDL_StopTextInput()
        assert sdl2.SDL_IsTextInputActive() == SDL_FALSE, _check_error_msg()
        sdl2.SDL_StartTextInput()
>       assert sdl2.SDL_IsTextInputActive() == SDL_TRUE, _check_error_msg()
E       AssertionError: 
E       assert 0 == 1
E        +  where 0 = <_FuncPtr object at 0x7f4113b60590>()
E        +    where <_FuncPtr object at 0x7f4113b60590> = sdl2.SDL_IsTextInputActive
sdl2/test/keyboard_test.py:155: AssertionError
________________________ TestSDLLog.test_SDL_LogMessage ________________________
self = <sdl2.test.log_test.TestSDLLog object at 0x7f4113357c50>
    def test_SDL_LogMessage(self):
        self.logdata = []  # reset the log
        sdl2.SDL_LogMessage(sdl2.SDL_LOG_CATEGORY_APPLICATION,
                           sdl2.SDL_LOG_PRIORITY_VERBOSE, b"test")
>       assert self.logdata[0] == (
            None,   sdl2.SDL_LOG_CATEGORY_APPLICATION,
            sdl2.SDL_LOG_PRIORITY_VERBOSE, b"test"
        )
E       AssertionError: assert (None, 0, 2, b'test') == (None, 0, 1, b'test')
E         
E         At index 2 diff: 2 != 1
E         
E         Full diff:
E           (
E               None,
E               0,...
E         
E         ...Full output truncated (6 lines hidden), use '-vv' to show
sdl2/test/log_test.py:29: AssertionError
___________________________ TestSDLLog.test_SDL_Log ____________________________
self = <sdl2.test.log_test.TestSDLLog object at 0x7f4113357b10>
    def test_SDL_Log(self):
        self.logdata = []  # reset the log
        sdl2.SDL_Log(b"test")
>       assert self.logdata[0] == (
            None, sdl2.SDL_LOG_CATEGORY_APPLICATION,
            sdl2.SDL_LOG_PRIORITY_INFO, b"test"
        )
E       AssertionError: assert (None, 0, 4, b'test') == (None, 0, 3, b'test')
E         
E         At index 2 diff: 4 != 3
E         
E         Full diff:
E           (
E               None,
E               0,...
E         
E         ...Full output truncated (6 lines hidden), use '-vv' to show
sdl2/test/log_test.py:54: AssertionError
_______________________ TestSDLLog.test_SDL_LogCritical ________________________
self = <sdl2.test.log_test.TestSDLLog object at 0x7f4110ee8510>
    def test_SDL_LogCritical(self):
        self.logdata = []  # reset the log
        sdl2.SDL_LogCritical(sdl2.SDL_LOG_CATEGORY_APPLICATION, b"test")
>       assert self.logdata[0] == (
            None, sdl2.SDL_LOG_CATEGORY_APPLICATION,
            sdl2.SDL_LOG_PRIORITY_CRITICAL, b"test"
        )
E       AssertionError: assert (None, 0, 7, b'test') == (None, 0, 6, b'test')
E         
E         At index 2 diff: 7 != 6
E         
E         Full diff:
E           (
E               None,
E               0,...
E         
E         ...Full output truncated (6 lines hidden), use '-vv' to show
sdl2/test/log_test.py:67: AssertionError
_________________________ TestSDLLog.test_SDL_LogDebug _________________________
self = <sdl2.test.log_test.TestSDLLog object at 0x7f4110ee8770>
    def test_SDL_LogDebug(self):
        self.logdata = []  # reset the log
        sdl2.SDL_LogDebug(sdl2.SDL_LOG_CATEGORY_APPLICATION, b"test")
>       assert self.logdata[0] == (
            None, sdl2.SDL_LOG_CATEGORY_APPLICATION,
            sdl2.SDL_LOG_PRIORITY_DEBUG, b"test"
        )
E       AssertionError: assert (None, 0, 3, b'test') == (None, 0, 2, b'test')
E         
E         At index 2 diff: 3 != 2
E         
E         Full diff:
E           (
E               None,
E               0,...
E         
E         ...Full output truncated (6 lines hidden), use '-vv' to show
sdl2/test/log_test.py:84: AssertionError
_________________________ TestSDLLog.test_SDL_LogError _________________________
self = <sdl2.test.log_test.TestSDLLog object at 0x7f4110c9ef90>
    def test_SDL_LogError(self):
        self.logdata = []  # reset the log
        sdl2.SDL_LogError(sdl2.SDL_LOG_CATEGORY_APPLICATION, b"test")
>       assert self.logdata[0] == (
            None, sdl2.SDL_LOG_CATEGORY_APPLICATION,
            sdl2.SDL_LOG_PRIORITY_ERROR, b"test"
        )
E       AssertionError: assert (None, 0, 6, b'test') == (None, 0, 5, b'test')
E         
E         At index 2 diff: 6 != 5
E         
E         Full diff:
E           (
E               None,
E               0,...
E         
E         ...Full output truncated (6 lines hidden), use '-vv' to show
sdl2/test/log_test.py:101: AssertionError
_________________________ TestSDLLog.test_SDL_LogInfo __________________________
self = <sdl2.test.log_test.TestSDLLog object at 0x7f41131e6580>
    def test_SDL_LogInfo(self):
        self.logdata = []  # reset the log
        sdl2.SDL_LogInfo(sdl2.SDL_LOG_CATEGORY_APPLICATION, b"test")
>       assert self.logdata[0] == (
            None, sdl2.SDL_LOG_CATEGORY_APPLICATION,
            sdl2.SDL_LOG_PRIORITY_INFO, b"test"
        )
E       AssertionError: assert (None, 0, 4, b'test') == (None, 0, 3, b'test')
E         
E         At index 2 diff: 4 != 3
E         
E         Full diff:
E           (
E               None,
E               0,...
E         
E         ...Full output truncated (6 lines hidden), use '-vv' to show
sdl2/test/log_test.py:118: AssertionError
________________________ TestSDLLog.test_SDL_LogVerbose ________________________
self = <sdl2.test.log_test.TestSDLLog object at 0x7f41131e6140>
    def test_SDL_LogVerbose(self):
        self.logdata = []  # reset the log
        sdl2.SDL_LogVerbose(sdl2.SDL_LOG_CATEGORY_APPLICATION, b"test")
>       assert self.logdata[0] == (
            None, sdl2.SDL_LOG_CATEGORY_APPLICATION,
            sdl2.SDL_LOG_PRIORITY_VERBOSE, b"test"
        )
E       AssertionError: assert (None, 0, 2, b'test') == (None, 0, 1, b'test')
E         
E         At index 2 diff: 2 != 1
E         
E         Full diff:
E           (
E               None,
E               0,...
E         
E         ...Full output truncated (6 lines hidden), use '-vv' to show
sdl2/test/log_test.py:135: AssertionError
_________________________ TestSDLLog.test_SDL_LogWarn __________________________
self = <sdl2.test.log_test.TestSDLLog object at 0x7f41131c9d50>
    def test_SDL_LogWarn(self):
        self.logdata = []  # reset the log
        sdl2.SDL_LogWarn(sdl2.SDL_LOG_CATEGORY_APPLICATION, b"test")
>       assert self.logdata[0] == (
            None, sdl2.SDL_LOG_CATEGORY_APPLICATION,
            sdl2.SDL_LOG_PRIORITY_WARN, b"test"
        )
E       AssertionError: assert (None, 0, 5, b'test') == (None, 0, 4, b'test')
E         
E         At index 2 diff: 5 != 4
E         
E         Full diff:
E           (
E               None,
E               0,...
E         
E         ...Full output truncated (6 lines hidden), use '-vv' to show
sdl2/test/log_test.py:152: AssertionError
_________________ TestSDLLog.test_SDL_LogGetSetOutputFunction __________________
self = <sdl2.test.log_test.TestSDLLog object at 0x7f4110c39ef0>
    def test_SDL_LogGetSetOutputFunction(self):
        logentries = []
    
        def __log(userdata, category, priority, message):
            if userdata:
                userdata = ctypes.cast(userdata, ctypes.c_char_p).value
            logentries.append((userdata, category, priority, message,))
    
        # setUp should have set our output function already.
        origfunc = sdl2.SDL_LogOutputFunction()
        origdata = ctypes.c_void_p(0)
        sdl2.SDL_LogGetOutputFunction(ctypes.byref(origfunc),
                                     ctypes.byref(origdata))
        assert not origdata
        logcount = len(self.logdata)
        origfunc(None, 0, 0, b"test_log_get_set_output_function")
        assert len(self.logdata) == logcount + 1
        assert self.logdata[logcount][3] == b"test_log_get_set_output_function"
    
        logptr = sdl2.SDL_LogOutputFunction(__log)
        userdata = ctypes.c_char_p(b"Testobject")
        sdl2.SDL_LogSetOutputFunction(logptr, userdata)
        ptr = sdl2.SDL_LogOutputFunction()
        userdata = ctypes.c_void_p(0)
        sdl2.SDL_LogGetOutputFunction(ctypes.byref(ptr), ctypes.byref(userdata))
        userdata = ctypes.cast(userdata, ctypes.c_char_p)
        assert userdata.value == b"Testobject"
        sdl2.SDL_Log(b"output test")
>       assert logentries[0] == (
            b"Testobject", sdl2.SDL_LOG_CATEGORY_APPLICATION,
            sdl2.SDL_LOG_PRIORITY_INFO, b"output test"
        )
E       AssertionError: assert (b'Testobject...'output test') == (b'Testobject...'output test')
E         
E         At index 2 diff: 4 != 3
E         
E         Full diff:
E           (
E               b'Testobject',
E               0,...
E         
E         ...Full output truncated (6 lines hidden), use '-vv' to show
sdl2/test/log_test.py:273: AssertionError
__________________________ test_SDL_HasIntersectionF ___________________________
    @pytest.mark.skipif(sdl2.dll.version < 2022, reason="not available")
    def test_SDL_HasIntersectionF():
        tests = [
            [(0, 0, 0, 0), (0, 0, 0, 0), SDL_FALSE],
            [(0, 0, -200, 200), (0, 0, -200, 200), SDL_FALSE],
            [(0, 0, 10, 10), (-5, 5, 10, 2), SDL_TRUE],
            [(0, 0, 10, 10), (-5, -5, 10, 2), SDL_FALSE],
            [(0, 0, 10, 10), (-5, -5, 2, 10), SDL_FALSE],
            [(0, 0, 10, 10), (-5, -5, 5, 5), SDL_FALSE],
            [(0, 0, 10, 10), (-5, -5, 5.1, 5.1), SDL_TRUE],
            [(0, 0, 10, 10), (-4.99, -4.99, 5, 5), SDL_TRUE],
        ]
        for rect1, rect2, expected in tests:
            r1 = sdl2.SDL_FRect(*rect1)
            r2 = sdl2.SDL_FRect(*rect2)
>           assert sdl2.SDL_HasIntersectionF(r1, r2) == expected
E           assert 1 == 0
E            +  where 1 = <_FuncPtr object at 0x7f41141187d0>(SDL_FRect(x=0.000, y=0.000, w=0.000, h=0.000), SDL_FRect(x=0.000, y=0.000, w=0.000, h=0.000))
E            +    where <_FuncPtr object at 0x7f41141187d0> = sdl2.SDL_HasIntersectionF
sdl2/test/rect_test.py:502: AssertionError
___________________________ test_SDL_IntersectFRect ____________________________
    @pytest.mark.skipif(sdl2.dll.version < 2022, reason="not available")
    def test_SDL_IntersectFRect():
        tests = [
            [(0, 0, 0, 0), (0, 0, 0, 0), SDL_FALSE, None],
            [(0, 0, -200, 200), (0, 0, -200, 200), SDL_FALSE, None],
            [(0, 0, 10, 10), (-5, 5, 9.9, 2), SDL_TRUE, (0, 5, 4.9, 2)],
            [(0, 0, 10, 10), (-5, -5, 10, 2), SDL_FALSE, None],
            [(0, 0, 10, 10), (-5, -5, 2, 10), SDL_FALSE, None],
            [(0, 0, 10, 10), (-5, -5, 5, 5), SDL_FALSE, None],
            [(0, 0, 10, 10), (-5, -5, 5.5, 6), SDL_TRUE, (0, 0, 0.5, 1)]
        ]
        res = sdl2.SDL_FRect()
        for rect1, rect2, expected_ret, expected_rect in tests:
            r1 = sdl2.SDL_FRect(*rect1)
            r2 = sdl2.SDL_FRect(*rect2)
            ret = sdl2.SDL_IntersectFRect(r1, r2, byref(res))
>           assert ret == expected_ret
E           assert 1 == 0
sdl2/test/rect_test.py:520: AssertionError
_____________________________ test_SDL_UnionFRect ______________________________
    @pytest.mark.skipif(sdl2.dll.version < 2022, reason="not available")
    def test_SDL_UnionFRect():
        tests = [
            [(0, 0, 10, 10), (19.9, 20, 10, 10), (0, 0, 29.9, 30)],
            [(0, 0, 0, 0), (20, 20.1, 10.1, 10), (20, 20.1, 10.1, 10)],
            [(-200, -4.5, 450, 33), (20, 20, 10, 10), (-200, -4.5, 450, 34.5)],
            [(0, 0, 15, 16.5), (20, 20, 0, 0), (0, 0, 15, 16.5)]
        ]
        out = sdl2.SDL_FRect()
        for rect1, rect2, expected in tests:
            r1 = sdl2.SDL_FRect(*rect1)
            r2 = sdl2.SDL_FRect(*rect2)
            sdl2.SDL_UnionFRect(r1, r2, byref(out))
            res = (out.x, out.y, out.w, out.h)
>           assert tuple([round(n, 6) for n in res]) == expected
E           AssertionError: assert (0.0, 0.0, 30.1, 30.1) == (20, 20.1, 10.1, 10)
E             
E             At index 0 diff: 0.0 != 20
E             
E             Full diff:
E               (
E             -     20,
E             ?     ^...
E             
E             ...Full output truncated (13 lines hidden), use '-vv' to show
sdl2/test/rect_test.py:538: AssertionError
___________________________ test_SDL_EncloseFPoints ____________________________
    @pytest.mark.skipif(sdl2.dll.version < 2022, reason="not available")
    def test_SDL_EncloseFPoints():
        tests = [
            [sdl2.SDL_FRect(0, 0, 10, 10), SDL_TRUE, (0.5, 0.1, 6, 8)],
            [sdl2.SDL_FRect(1.2, 1, 10, 10), SDL_TRUE, (1.5, 1.1, 5, 7)],
            [sdl2.SDL_FRect(-10, -10, 3, 3), SDL_FALSE, (0, 0, 0, 0)],
            [None, SDL_TRUE, (0.5, 0.1, 6, 8)],
        ]
        pt1, pt2 = [sdl2.SDL_FPoint(0.5, 0.1), sdl2.SDL_FPoint(5.5, 7.1)]
        pt3 = sdl2.SDL_FPoint(1.5, 1.1)
        points = to_ctypes([pt1, pt2, pt3], sdl2.SDL_FPoint)
        res = sdl2.SDL_FRect()
        for clip, expected_ret, expected_rect in tests:
            clip_p = byref(clip) if isinstance(clip, sdl2.SDL_FRect) else None
            ret = sdl2.SDL_EncloseFPoints(points, 3, clip_p, byref(res))
            assert ret == expected_ret
            r = sdl2.SDL_FRect(*expected_rect)
>           assert res == r if ret == SDL_TRUE else res != r
E           assert False
sdl2/test/rect_test.py:557: AssertionError
________________________ test_SDL_IntersectFRectAndLine ________________________
    @pytest.mark.skipif(sdl2.dll.version < 2022, reason="not available")
    def test_SDL_IntersectFRectAndLine():
        tests = [
            [(0, 0, 0, 0), (-4.8, -4.8, 5.2, 5.2), SDL_FALSE, None],
            [(0, 0, 2, 2), (-1, -1, 3.5, 3.5), SDL_TRUE, (0, 0, 1, 1)],
            [(-4, -4, 14, 14), (8, 22, 8, 33), SDL_FALSE, None]
        ]
        for rect1, line, expected_ret, expected_coords in tests:
            r = sdl2.SDL_FRect(*rect1)
            x1, y1, x2, y2 = line
            x1, y1, x2, y2 = c_float(x1), c_float(y1), c_float(x2), c_float(y2)
            ret = sdl2.SDL_IntersectFRectAndLine(
                r, byref(x1), byref(y1), byref(x2), byref(y2))
>           assert ret == expected_ret
E           assert 1 == 0
sdl2/test/rect_test.py:576: AssertionError
_______________________ test_SDL_GetSetTextureScaleMode ________________________
texture = <sdl2.render.LP_SDL_Texture object at 0x7f4110246750>
    @pytest.mark.skipif(sdl2.dll.version < 2012, reason="not available")
    def test_SDL_GetSetTextureScaleMode(texture):
        modes = (
            sdl2.SDL_ScaleModeNearest,
            sdl2.SDL_ScaleModeLinear,
            sdl2.SDL_ScaleModeBest,
        )
        for mode in modes:
            ret = sdl2.SDL_SetTextureScaleMode(texture, mode)
            assert ret == 0, _check_error_msg()
            tmode = sdl2.SDL_ScaleMode()
            ret = sdl2.SDL_GetTextureScaleMode(texture, byref(tmode))
            assert ret == 0, _check_error_msg()
>           assert tmode.value == mode
E           assert 1 == 2
E            +  where 1 = c_int(1).value
sdl2/test/render_test.py:446: AssertionError
__________________________ TestExtRenderer.test_init ___________________________
self = <sdl2.test.sdl2ext_renderer_test.TestExtRenderer object at 0x7f4110a78e10>
with_sdl = None
    def test_init(self, with_sdl):
        sf = SDL_CreateRGBSurface(0, 10, 10, 32, 0, 0, 0, 0)
    
        # Create renderer with SDL_Surface
        renderer = sdl2ext.Renderer(sf.contents)
        assert addressof(renderer.rendertarget) == addressof(sf.contents)
        assert isinstance(renderer.sdlrenderer.contents, SDL_Renderer)
        renderer.destroy()
    
        # Create renderer with SDL_Surface pointer
        renderer = sdl2ext.Renderer(sf)
        assert renderer.rendertarget == sf
        assert isinstance(renderer.sdlrenderer.contents, SDL_Renderer)
        renderer.destroy()
    
        # Create renderer with SoftwareSprite
        sprite = sdl2ext.SoftwareSprite(sf.contents, True)
        renderer = sdl2ext.Renderer(sprite)
        assert renderer.rendertarget == sprite
        assert isinstance(renderer.sdlrenderer.contents, SDL_Renderer)
        renderer.destroy()
    
        # Create renderer with Window
        window = sdl2ext.Window("Test", size=(1, 1))
        renderer = sdl2ext.Renderer(window)
        assert renderer.rendertarget == window
        assert isinstance(renderer.sdlrenderer.contents, SDL_Renderer)
        renderer.destroy()
        del window
    
        # Create software renderer with Window
        window = sdl2ext.Window("Test", size=(1, 1))
>       renderer = sdl2ext.Renderer(window, backend='software')
sdl2/test/sdl2ext_renderer_test.py:93: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
sdl2/ext/renderer.py:381: in __init__
    raise_sdl_err("creating the SDL renderer")
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
desc = 'creating the SDL renderer'
    def raise_sdl_err(desc=None):
        """Raises an exception for an internal SDL error.
    
        The format of the exception message depends on whether a description is
        provided and whether `:func:~sdl2.SDL_GetError` returns an error string.
        If a description is given, it will be appended after the default text
        ``Error encountered``. If SDL has set an error string, it will be appended
        to the end of the message following a colon (clearing the error in the
        process).
    
        For example, if ``SDL_GetError() == b"unsupported pixel format"`` and the
        function is called as ``raise_sdl_err("creating the surface")``, the
        resulting exception message will be "Error encountered creating the surface:
        unsupported pixel format".
    
        Args:
            desc (str. optional): A description of what SDL was trying to do when
                the error occurred. Will be placed after the text "Error encountered"
                in the exception message if provided.
    
        Raises:
            :exc:`~SDLError`: An exception explaining the most recent SDL error.
    
        """
        errmsg = error.SDL_GetError().decode('utf-8')
        error.SDL_ClearError()
        e = "Error encountered"
        if desc:
            e += " " + desc
        if len(errmsg):
            e += ": {0}".format(errmsg)
>       raise SDLError(e)
E       sdl2.ext.err.SDLError: "Error encountered creating the SDL renderer: Couldn't find matching render driver"
sdl2/ext/err.py:57: SDLError
__________________________ TestExtRenderer.test_copy ___________________________
self = <sdl2.test.sdl2ext_renderer_test.TestExtRenderer object at 0x7f41100097b0>
with_sdl = None
    def test_copy(self, with_sdl):
        # Initialize target surface and renderer
        surface = SDL_CreateRGBSurface(0, 128, 128, 32, 0, 0, 0, 0).contents
        renderer = sdl2ext.Renderer(surface)
        renderer.clear(0xAABBCC)
        view = sdl2ext.PixelView(surface)
    
        # Test copying a Texture without any arguments (should fill surface)
        sf = SDL_CreateRGBSurface(0, 16, 16, 32, 0, 0, 0, 0)
        sdl2ext.fill(sf, (0, 0, 0, 0))
        tx = sdl2ext.Texture(renderer, sf)
        renderer.copy(tx)
        renderer.present()
        assert view[0][0] == 0
        assert view[127][127] == 0
    
        # Test copying a Texture with only location argument
        renderer.clear(0xAABBCC) # reset surface
        renderer.copy(tx, dstrect=(10, 10))
        renderer.present()
        assert view[0][0] == 0xAABBCC
        assert view[10][10] == 0
        assert view[25][25] == 0
        assert view[26][26] == 0xAABBCC
    
        # Test copying a subset of a Texture
        renderer.clear(0xAABBCC) # reset surface
        renderer.copy(tx, srcrect=(0, 0, 10, 10), dstrect=(10, 10))
        renderer.present()
        assert view[0][0] == 0xAABBCC
        assert view[10][10] == 0
        assert view[19][19] == 0
        assert view[20][20] == 0xAABBCC
    
        # Test copying a subset of a Texture w/ point/rect args
        renderer.clear(0xAABBCC) # reset surface
        renderer.copy(tx, srcrect=SDL_Rect(0, 0, 10, 10), dstrect=SDL_Point(10, 10))
        renderer.present()
        assert view[0][0] == 0xAABBCC
        assert view[10][10] == 0
        assert view[19][19] == 0
        assert view[20][20] == 0xAABBCC
    
        # Test copying a Texture with location and size
        renderer.clear(0xAABBCC) # reset surface
        renderer.copy(tx, dstrect=(10, 10, 30, 40))
        renderer.present()
        assert view[0][0] == 0xAABBCC
        assert view[10][10] == 0
        assert view[49][39] == 0
        assert view[50][40] == 0xAABBCC
    
        if dll.version > 2005:
            # Test copying a Texture with rotation
            renderer.clear(0xAABBCC) # reset surface
            renderer.copy(tx, dstrect=(32, 32), angle=180, center=(0, 0))
            renderer.present()
            assert view[0][0] == 0xAABBCC
>           assert view[16][16] == 0xFF000000  # Rotation suddenly adds alpha?
E           assert 0 == 4278190080
sdl2/test/sdl2ext_renderer_test.py:273: AssertionError
________________ TestSpriteFactory.test_create_software_sprite _________________
self = <sdl2.test.sdl2ext_spritesystem_test.TestSpriteFactory object at 0x7f4110a22780>
with_sdl = None
    def test_create_software_sprite(self, with_sdl):
        factory = sdl2ext.SpriteFactory(sdl2ext.SOFTWARE)
        for w, h in sprite_test_sizes:
            for bpp in (1, 4, 8, 12, 15, 16, 24, 32):
                SDL_ClearError()
                sprite = factory.create_software_sprite((w, h), bpp)
                assert sprite, _check_error_msg()
                assert isinstance(sprite, sdl2ext.SoftwareSprite)
    
        with pytest.raises(TypeError):
            factory.create_software_sprite(size=None)
>       with pytest.raises(sdl2ext.SDLError):
E       Failed: DID NOT RAISE <class 'sdl2.ext.err.SDLError'>
sdl2/test/sdl2ext_spritesystem_test.py:108: Failed
________________________________ test_init_quit ________________________________
    def test_init_quit():
        # NOTE: Currently init only inits the video subsystem, but quit shuts down
        # SDL2 and ttf/image/mixer libraries. This latter function should be tested.
        try:
            sdl2ext.init()
        except sdl2ext.SDLError:
            raise pytest.skip('Video subsystem not supported')
        assert SDL_WasInit(sdl2.SDL_INIT_VIDEO) == sdl2.SDL_INIT_VIDEO
        assert SDL_WasInit(sdl2.SDL_INIT_EVENTS) == sdl2.SDL_INIT_EVENTS
        sdl2ext.quit()
        assert SDL_WasInit(sdl2.SDL_INIT_VIDEO) != sdl2.SDL_INIT_VIDEO
        sdl2ext.init()
        sdl2ext.init()
        sdl2ext.init()
        assert SDL_WasInit(sdl2.SDL_INIT_VIDEO) == sdl2.SDL_INIT_VIDEO
        sdl2ext.quit()
        assert SDL_WasInit(sdl2.SDL_INIT_VIDEO) != sdl2.SDL_INIT_VIDEO
    
        # Test initializing other subsystems
        sdl2ext.init(video=False, events=True)
        assert SDL_WasInit(sdl2.SDL_INIT_VIDEO) != sdl2.SDL_INIT_VIDEO
        assert SDL_WasInit(sdl2.SDL_INIT_EVENTS) == sdl2.SDL_INIT_EVENTS
        sdl2ext.init(video=True, audio=True, timer=True)
        assert SDL_WasInit(sdl2.SDL_INIT_VIDEO) == sdl2.SDL_INIT_VIDEO
        assert SDL_WasInit(sdl2.SDL_INIT_AUDIO) == sdl2.SDL_INIT_AUDIO
>       assert SDL_WasInit(sdl2.SDL_INIT_TIMER) == sdl2.SDL_INIT_TIMER
E       assert 0 == 1
E        +  where 0 = SDL_WasInit(1)
E        +    where 1 = sdl2.SDL_INIT_TIMER
E        +  and   1 = sdl2.SDL_INIT_TIMER
sdl2/test/sdl2ext_test.py:44: AssertionError
________________________________ test_SDL_Init _________________________________
    def test_SDL_Init():
        supported = []
        sdl2.SDL_ClearError()
        for name, flags in subsystems.items():
            ret = sdl2.SDL_Init(flags)
            err = sdl2.SDL_GetError()
            if ret == 0 and sdl2.SDL_WasInit(0) & flags == flags:
                supported.append(name)
            else:
                # If essential subsystem doesn't load, fail test
                if name in ['timer', 'audio', 'video', 'events']:
>                   assert False, err.decode('utf-8', 'replace')
E                   AssertionError: 
E                   assert False
sdl2/test/sdl_test.py:33: AssertionError
____________________________ test_SDL_InitSubSystem ____________________________
    def test_SDL_InitSubSystem():
        sdl2.SDL_ClearError()
        ret = sdl2.SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO)
        assert ret == 0, _check_error_msg()
        # Test initializing an additional subsystem
        assert sdl2.SDL_WasInit(0) & SDL_INIT_TIMER != SDL_INIT_TIMER
        ret = sdl2.SDL_InitSubSystem(SDL_INIT_TIMER)
        assert ret == 0, _check_error_msg()
>       assert sdl2.SDL_WasInit(0) & SDL_INIT_TIMER == SDL_INIT_TIMER
E       assert (16432 & 1) == 1
E        +  where 16432 = <_FuncPtr object at 0x7f41142199d0>(0)
E        +    where <_FuncPtr object at 0x7f41142199d0> = sdl2.SDL_WasInit
sdl2/test/sdl_test.py:51: AssertionError
____________________________ test_SDL_SetWindowIcon ____________________________
window = <sdl2.video.LP_SDL_Window object at 0x7f4110ea8850>
    def test_SDL_SetWindowIcon(window):
        sf = surface.SDL_CreateRGBSurface(
            0, 16, 16, 16, 0xF000, 0x0F00, 0x00F0, 0x000F
        )
        assert isinstance(sf.contents, surface.SDL_Surface)
        sdl2.SDL_ClearError()
        sdl2.SDL_SetWindowIcon(window, sf)
        # TODO: This is not 100% safe, but in SDL2, SetWindowIcon returns void,
        # so we can't reliably detect error
>       assert SDL_GetError() == b""
E       AssertionError: assert b'That operat...not supported' == b''
E         
E         Full diff:
E         - b''
E         + (b'That operation is not supported')
sdl2/test/video_test.py:450: AssertionError

Comment 4 Neal Gompa 2025-01-22 01:06:15 UTC
I've just pushed through SDL3-3.2.0 and sdl2-compat-2.30.50 which should help with some of this. Upstream is looking into this though and will come back with some more fixes soon.

Comment 5 Sandro 2025-01-22 22:38:06 UTC
*** Bug 2341200 has been marked as a duplicate of this bug. ***

Comment 6 Aoife Moloney 2025-02-26 13:25:03 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 42 development cycle.
Changing version to 42.

Comment 7 Sandro 2025-03-12 22:03:49 UTC
(In reply to Neal Gompa from comment #4)
> I've just pushed through SDL3-3.2.0 and sdl2-compat-2.30.50 which should
> help with some of this. Upstream is looking into this though and will come
> back with some more fixes soon.

Any update on upstream's efforts? The package still fails to build.

Looking through the failing tests again and knowing all the same tests succeeded before the switch to sdl2-compat (F41) seems to indicate that the behavior of sdl2-compat is very different to SDL 2.

Comment 8 Neal Gompa 2025-03-21 23:19:53 UTC
I think some fixes went in with the latest SDL3 and sdl2-compat releases, which landed in F42+ yesterday.

Comment 9 Neal Gompa 2025-03-21 23:22:31 UTC
Actually, it looks like it's still in progress: https://github.com/libsdl-org/SDL/pull/12550#issuecomment-2741912459

Comment 10 Fedora Release Engineering 2025-03-30 04:22:24 UTC
Dear Maintainer,

your package has an open Fails To Build From Source bug for Fedora 42.
Action is required from you.

If you can fix your package to build, perform a build in koji, and either create
an update in bodhi, or close this bug without creating an update, if updating is
not appropriate [1]. If you are working on a fix, set the status to ASSIGNED to
acknowledge this. If you have already fixed this issue, please close this Bugzilla report.

Following the policy for such packages [2], your package will be orphaned if
this bug remains in NEW state more than 8 weeks (not sooner than 2025-03-17).

A week before the mass branching of Fedora 43 according to the schedule [3],
any packages not successfully rebuilt at least on Fedora 41 will be
retired regardless of the status of this bug.

[1] https://docs.fedoraproject.org/en-US/fesco/Updates_Policy/
[2] https://docs.fedoraproject.org/en-US/fesco/Fails_to_build_from_source_Fails_to_install/
[3] https://fedorapeople.org/groups/schedule/f-43/f-43-key-tasks.html

Comment 11 Sandro 2025-04-04 07:17:34 UTC
(In reply to Neal Gompa from comment #9)
> Actually, it looks like it's still in progress:
> https://github.com/libsdl-org/SDL/pull/12550#issuecomment-2741912459

Some more fixes have been merged and 2.32.54 has been released. I'll update this bug once that version is available in rawhide.

Comment 12 Neal Gompa 2025-04-11 18:56:11 UTC
I just landed it in Rawhide and submitted an update for F42 as well.

https://bodhi.fedoraproject.org/updates/FEDORA-2025-4de724dc7c

Comment 13 Neal Gompa 2025-04-11 19:40:47 UTC
There are also some post-release fixes that may be useful to backport: https://github.com/py-sdl/py-sdl2/commits/master/

Comment 14 Sandro 2025-04-11 21:06:43 UTC
Thanks! Release 2.32.54 looks very promising. Down to three failing test. I'll look into backporting PRs from upstream the coming days.

Comment 15 Sandro 2025-04-14 08:45:17 UTC
I looked into the remaining failing tests. On is fixed in pyside2 upstream[1] the other two I have reported to sdl2-compat and they are fixed already upstream[2]. With both backports applied I'm able to run all tests again successfully.

[1] https://github.com/py-sdl/py-sdl2/pull/280
[2] https://github.com/libsdl-org/sdl2-compat/pull/460

Comment 16 Sandro 2025-04-14 09:00:11 UTC
s/On is fixed in pyside2/One is fixed in pysdl2/ 🥱 ☕

Comment 17 Fedora Update System 2025-05-11 10:19:20 UTC
FEDORA-2025-1774b13616 (python-pysdl2-0.9.17-3.fc43) has been submitted as an update to Fedora 43.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-1774b13616

Comment 18 Fedora Update System 2025-05-11 10:23:10 UTC
FEDORA-2025-1774b13616 (python-pysdl2-0.9.17-3.fc43) has been pushed to the Fedora 43 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 19 Fedora Update System 2025-05-11 10:24:46 UTC
FEDORA-2025-9a0570871e (python-pysdl2-0.9.17-3.fc42) has been submitted as an update to Fedora 42.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-9a0570871e

Comment 20 Fedora Update System 2025-05-12 01:56:01 UTC
FEDORA-2025-9a0570871e (python-pysdl2-0.9.17-3.fc42) has been pushed to the Fedora 42 stable repository.
If problem still persists, please make note of it in this bug report.


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