libxml2 fails to build with Python 3.9.0a4. /usr/include/python3.9/object.h:623:41: error: expected '(' before 'PyType_HasFeature' 623 | #define PyType_FastSubclass(type, flag) PyType_HasFeature(type, flag) | ^~~~~~~~~~~~~~~~~ /usr/include/python3.9/unicodeobject.h:115:18: note: in expansion of macro 'PyType_FastSubclass' 115 | PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_UNICODE_SUBCLASS) | ^~~~~~~~~~~~~~~~~~~ ../../python/libxml.c:297:15: note: in expansion of macro 'PyUnicode_Check' 297 | } else if PyUnicode_Check (ret) { | ^~~~~~~~~~~~~~~ ../../python/libxml.c:297:37: error: expected ';' before '{' token 297 | } else if PyUnicode_Check (ret) { | ^ ../../python/libxml.c: In function 'xmlPythonFileRead': ../../python/libxml.c:354:5: warning: 'PyEval_CallMethod' is deprecated [-Wdeprecated-declarations] 354 | ret = PyEval_CallMethod(file, (char *) "io_read", (char *) "(i)", len); | ^~~ In file included from /usr/include/python3.9/Python.h:141, from ../../python/libxml.c:14: /usr/include/python3.9/ceval.h:28:43: note: declared here 28 | Py_DEPRECATED(3.9) PyAPI_FUNC(PyObject *) PyEval_CallMethod( | ^~~~~~~~~~~~~~~~~ In file included from /usr/include/python3.9/pytime.h:6, from /usr/include/python3.9/Python.h:85, from ../../python/libxml.c:14: /usr/include/python3.9/object.h:623:41: error: expected '(' before 'PyType_HasFeature' 623 | #define PyType_FastSubclass(type, flag) PyType_HasFeature(type, flag) | ^~~~~~~~~~~~~~~~~ /usr/include/python3.9/unicodeobject.h:115:18: note: in expansion of macro 'PyType_FastSubclass' 115 | PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_UNICODE_SUBCLASS) | ^~~~~~~~~~~~~~~~~~~ ../../python/libxml.c:362:15: note: in expansion of macro 'PyUnicode_Check' 362 | } else if PyUnicode_Check (ret) { | ^~~~~~~~~~~~~~~ ../../python/libxml.c:362:37: error: expected ';' before '{' token 362 | } else if PyUnicode_Check (ret) { | For the build logs, see: https://copr-be.cloud.fedoraproject.org/results/@python/python3.9/fedora-rawhide-x86_64/01255332-libxml2/ For all our attempts to build libxml2 with Python 3.9, see: https://copr.fedorainfracloud.org/coprs/g/python/python3.9/package/libxml2/ 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.9: https://copr.fedorainfracloud.org/coprs/g/python/python3.9/ Let us know here if you have any questions. Python 3.9 will be included in Fedora 33. To make that update smoother, we're building Fedora packages with early pre-releases of Python 3.9. 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.
In C, `if` expressions should be parenthesized, so that line should read: } else if (PyUnicode_Check (ret)) { I guess PyUnicode_Check happened to expand to a parenthesized expression before, but that's not API to rely on.
https://src.fedoraproject.org/rpms/libxml2/pull-request/9