python-multidict fails to build with Python 3.13.0a1. multidict/_multilib/defs.h:8:1: error: type defaults to ‘int’ in declaration of ‘_Py_IDENTIFIER’ [-Werror=implicit-int] multidict/_multilib/istr.h:46:8: error: implicit declaration of function ‘_PyObject_CallMethodId’; did you mean ‘PyObject_CallMethod’? [-Werror=implicit-function-declaration] 46 | s =_PyObject_CallMethodId(ret, &PyId_lower, NULL); | ^~~~~~~~~~~~~~~~~~~~~~ | PyObject_CallMethod multidict/_multilib/istr.h:46:37: error: ‘PyId_lower’ undeclared (first use in this function) 46 | s =_PyObject_CallMethodId(ret, &PyId_lower, NULL); | ^~~~~~~~~~ multidict/_multidict.c:712:5: error: implicit declaration of function ‘Py_TRASHCAN_SAFE_BEGIN’; did you mean ‘Py_TRASHCAN_BEGIN’? [-Werror=implicit-function-declaration] 712 | Py_TRASHCAN_SAFE_BEGIN(self); | ^~~~~~~~~~~~~~~~~~~~~~ | Py_TRASHCAN_BEGIN multidict/_multidict.c:718:5: error: implicit declaration of function ‘Py_TRASHCAN_SAFE_END’; did you mean ‘Py_TRASHCAN_END’? [-Werror=implicit-function-declaration] 718 | Py_TRASHCAN_SAFE_END(self); | ^~~~~~~~~~~~~~~~~~~~ | Py_TRASHCAN_END - ‘_Py_IDENTIFIER’ has been removed from Python 3.13. The detailed list of the removed private C API functions can be found here: https://github.com/python/cpython/issues/106320 - Remove the old trashcan macros Py_TRASHCAN_SAFE_BEGIN and Py_TRASHCAN_SAFE_END. They should be replaced by the new macros Py_TRASHCAN_BEGIN and Py_TRASHCAN_END. The new macros were added in Python 3.8 and the old macros were deprecated in Python 3.11. (Contributed by Irit Katriel in gh-105111.) 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/06578835-python-multidict/ For all our attempts to build python-multidict with Python 3.13, see: https://copr.fedorainfracloud.org/coprs/g/python/python3.13/package/python-multidict/ 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.
There have been multiple reverts in after Python 3.12~alpha1 and now python-multidict fails to build with those errors: - multiple times in multiple functions: multidict/_multidict.c: In function ‘multidict_getall’: multidict/_multidict.c:452:12: error: unknown type name ‘_PyArg_Parser’ 452 | static _PyArg_Parser _parser = {"O|O:getall", _keywords, 0}; | ^~~~~~~~~~~~~ multidict/_multidict.c:453:10: error: implicit declaration of function ‘_PyArg_ParseStackAndKeywords’; did you mean ‘PyArg_ParseTupleAndKeywords’? [-Werror=implicit-function-declaration] 453 | if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ | PyArg_ParseTupleAndKeywords
It’s possible to work around this by disabling the C extensions, at a significant performance cost: https://src.fedoraproject.org/rpms/python-multidict/pull-request/4 This may still be worth it until upstream can deal with the issue.
This package is already quite broken with Python 3.12: $ python3 Python 3.12.1 (main, Dec 18 2023, 00:00:00) [GCC 13.2.1 20231205 (Red Hat 13.2.1-6)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import multidict >>> m = multidict.MultiDict() >>> m.getall() Segmentation fault (core dumped) The internal _PyArg_Parser struct changed its members, so the initializer no longer works correctly. GCC 13 and earlier ignore the resulting C type errors, but GCC 14 will refuse to compile this by default, and rightly so, given that the code results in crashes at run time.
See also https://github.com/aio-libs/multidict/issues/926 which started as a report of build failures with GCC 14, but turned out it "misbuilt" with GCC 13.
This bug appears to have been reported against 'rawhide' during the Fedora Linux 40 development cycle. Changing version to 40.
Based on the successful build https://copr.fedorainfracloud.org/coprs/g/python/python3.13/build/7290479/, this was fixed by updating to 6.0.5 in https://bodhi.fedoraproject.org/updates/FEDORA-2024-4ac6ca5505.