pycairo fails to build with Python 3.13.0a4. =================================== FAILURES =================================== __________________ test_surface_get_set_mime_data_references ___________________ @pytest.mark.skipif(not hasattr(sys, "getrefcount"), reason="PyPy") def test_surface_get_set_mime_data_references(): surface = cairo.ImageSurface(cairo.FORMAT_RGB24, 1, 1) v = memoryview(b"bla") x = v[:1] recfcount_v = sys.getrefcount(v) recfcount_x = sys.getrefcount(x) assert recfcount_v == recfcount_x > surface.set_mime_data("foo", v) E SystemError: /builddir/build/BUILD/Python-3.13.0a4/Objects/abstract.c:430: bad argument to internal function tests/test_api.py:282: SystemError ________________________ test_surface_mime_data_for_pdf ________________________ @pytest.mark.skipif( sysconfig.get_platform().startswith("win"), reason="msvc fixme") def test_surface_mime_data_for_pdf(): jpeg_bytes = zlib.decompress(base64.b64decode( b'eJz7f+P/AwYBLzdPNwZGRkYGDyBk+H+bwRnEowj8P8TAzcHACDJHkOH/EQYRIBsV' b'cP6/xcDBCBJlrLcHqRBAV8EAVcHIylSPVwGbPQEFjPaK9XDrBAipBSq4CQB9jiS0' )) file_like = io.BytesIO() surface = cairo.PDFSurface(file_like, 3, 3) context = cairo.Context(surface) image = cairo.ImageSurface(cairo.FORMAT_RGB24, 1, 1) > image.set_mime_data(cairo.MIME_TYPE_JPEG, jpeg_bytes) E SystemError: /builddir/build/BUILD/Python-3.13.0a4/Objects/abstract.c:430: bad argument to internal function tests/test_api.py:308: SystemError ________________________ test_surface_get_set_mime_data ________________________ def test_surface_get_set_mime_data(): surface = cairo.ImageSurface(cairo.FORMAT_RGB24, 1, 1) assert surface.get_mime_data("foo") is None assert surface.get_mime_data(cairo.MIME_TYPE_JPEG) is None > surface.set_mime_data("foo", b"bar") E SystemError: /builddir/build/BUILD/Python-3.13.0a4/Objects/abstract.c:430: bad argument to internal function tests/test_surface.py:478: SystemError =========================== short test summary info ============================ FAILED tests/test_api.py::test_surface_get_set_mime_data_references - SystemE... FAILED tests/test_api.py::test_surface_mime_data_for_pdf - SystemError: /buil... FAILED tests/test_surface.py::test_surface_get_set_mime_data - SystemError: /... =================== 3 failed, 268 passed, 3 skipped in 0.48s =================== https://docs.python.org/3.13/whatsnew/3.13.html For the build logs, see: https://copr-be.cloud.fedoraproject.org/results/@python/python3.13/fedora-rawhide-x86_64/07033691-pycairo/ For all our attempts to build pycairo with Python 3.13, see: https://copr.fedorainfracloud.org/coprs/g/python/python3.13/package/pycairo/ 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.13: https://copr.fedorainfracloud.org/coprs/g/python/python3.13/ Let us know here if you have any questions. Python 3.13 is planned to be included in Fedora 41. To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.13. 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.
This is blocking pygobject3, which is blocking 100+ other packages.
Updating to 1.26.0 does not help.
Reported upstream at https://github.com/pygobject/pycairo/issues/365
(In reply to Miro Hrončok from comment #1) > This is blocking pygobject3, which is blocking 100+ other packages. Also transitively blocks python-pillow which is needed by 200+.
https://src.fedoraproject.org/rpms/pycairo/pull-request/8