Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at
Bug 1960117 - python-pyside2 is not compatible with Python 3.10
Summary: python-pyside2 is not compatible with Python 3.10
Status: CLOSED DUPLICATE of bug 1902618
Alias: None
Product: Fedora
Classification: Fedora
Component: python-pyside2
Version: rawhide
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Richard Shaw
QA Contact: Fedora Extras Quality Assurance
Depends On:
Blocks: PYTHON3.10
TreeView+ depends on / blocked
Reported: 2021-05-13 05:20 UTC by Tomáš Hrnčiar
Modified: 2021-06-08 10:57 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2021-06-08 10:57:10 UTC
Type: Bug

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Qt Bug Tracker PYSIDE-1436 0 None None None 2021-05-13 12:10:25 UTC

Description Tomáš Hrnčiar 2021-05-13 05:20:38 UTC
freecad fails to build with Python 3.10.0b1.

[  2%] Building CXX object src/Base/CMakeFiles/FreeCADBase.dir/BaseClass.cpp.o
cd /builddir/build/BUILD/FreeCAD-0.19.2/x86_64-redhat-linux-gnu/src/Base && /usr/bin/g++ -DFreeCADBase_EXPORTS -DHAVE_CONFIG_H -DHAVE_SWIG=1 -DPYCXX_6_2_COMPATIBILITY -DPYCXX_PYTHON_2TO3 -DQT_CORE_LIB -DQT_NO_DEBUG -D_OCC64 -I/builddir/build/BUILD/FreeCAD-0.19.2/x86_64-redhat-linux-gnu -I/builddir/build/BUILD/FreeCAD-0.19.2/x86_64-redhat-linux-gnu/src -I/builddir/build/BUILD/FreeCAD-0.19.2/src -I/builddir/build/BUILD/FreeCAD-0.19.2/x86_64-redhat-linux-gnu/src/Base -I/builddir/build/BUILD/FreeCAD-0.19.2/src/Base -I/usr/include/python3.10 -isystem /usr/include/qt5 -isystem /usr/include/qt5/QtCore -isystem /usr/lib64/qt5/mkspecs/linux-g++ -Wall -Wextra -Wno-write-strings -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fPIC -fPIC -std=gnu++11 -MD -MT src/Base/CMakeFiles/FreeCADBase.dir/BaseClass.cpp.o -MF CMakeFiles/FreeCADBase.dir/BaseClass.cpp.o.d -o CMakeFiles/FreeCADBase.dir/BaseClass.cpp.o -c /builddir/build/BUILD/FreeCAD-0.19.2/src/Base/BaseClass.cpp
In file included from /usr/include/python3.10/unicodeobject.h:1046,
                 from /usr/include/python3.10/Python.h:87,
                 from /builddir/build/BUILD/FreeCAD-0.19.2/src/Base/PyObjectBase.h:38,
                 from /builddir/build/BUILD/FreeCAD-0.19.2/src/Base/BaseClass.cpp:32:
/usr/include/CXX/Python3/Objects.hxx: In member function 'const Py_UNICODE* Py::String::unicode_data() const':
/usr/include/python3.10/cpython/unicodeobject.h:279:26: warning: 'Py_UNICODE* PyUnicode_AsUnicode(PyObject*)' is deprecated [-Wdeprecated-declarations]
  279 |       PyUnicode_AsUnicode(_PyObject_CAST(op)))
      |       ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
/usr/include/python3.10/cpython/unicodeobject.h:580:45: note: declared here
  580 | Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
      |                                             ^~~~~~~~~~~~~~~~~~~

bpo-36346: Mark Py_UNICODE_COPY, Py_UNICODE_FILL, PyUnicode_WSTR_LENGTH, PyUnicode_FromUnicode, PyUnicode_AsUnicode, and PyUnicode_AsUnicodeAndSize as deprecated in C. Remove Py_UNICODE_MATCH which was deprecated and broken since Python 3.3.

For the build logs, see:

For all our attempts to build freecad with Python 3.10, see:

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.10:

Let us know here if you have any questions.

Python 3.10 will be included in Fedora 35. To make that update smoother, we're building Fedora packages with early pre-releases of Python 3.10.
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.

Comment 1 Richard Shaw 2021-05-13 11:51:30 UTC
I don't see an actual error in the above, just warnings. While not ideal FreeCAD is very large so often only real problems get worked on.

In inspecting the log file I do see:

PySide2/ Unable to import shiboken2 from , /usr/lib64/, /usr/lib64/python3.10, /usr/lib64/python3.10/lib-dynload, /usr/lib64/python3.10/site-packages, /usr/lib/python3.10/site-packages
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib64/python3.10/site-packages/PySide2/", line 107, in <module>
  File "/usr/lib64/python3.10/site-packages/PySide2/", line 58, in _setupQtDirectories
    import shiboken2
  File "/usr/lib64/python3.10/site-packages/shiboken2/", line 27, in <module>
    from .shiboken2 import *
ImportError: /lib64/ undefined symbol: _Py_Mangle
PySide2 Python module not found.


[ 71%] Linking CXX executable ../../bin/FreeCAD
cd /builddir/build/BUILD/FreeCAD-0.19.2/x86_64-redhat-linux-gnu/src/Main && /usr/bin/cmake -E cmake_link_script CMakeFiles/FreeCADMain.dir/link.txt --verbose=1
/usr/bin/g++ -Wall -Wextra -Wno-write-strings -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld CMakeFiles/FreeCADMain.dir/MainGui.cpp.o -o ../../bin/FreeCAD  -Wl,-rpath,/builddir/build/BUILD/FreeCAD-0.19.2/x86_64-redhat-linux-gnu/lib: ../../lib/ ../../lib/ ../../lib/ /usr/lib64/ /usr/lib64/ /usr/lib64/ -lutil -ldl /usr/lib64/ /usr/lib64/ /usr/lib64/ /usr/lib64/ /usr/lib64/ -lboost_thread /usr/lib64/ /usr/lib64/ /usr/lib64/ -lpthread /usr/lib64/ -lCoin /usr/lib64/ /usr/lib64/ /usr/lib64/ /usr/lib64/ /usr/lib64/ /usr/lib64/libQt5UiTools.a /usr/lib64/ /usr/lib64/ /usr/lib64/ /usr/lib64// /usr/lib64// /usr/lib64// /usr/lib64// /usr/lib64// /usr/lib64// /usr/lib64/ -lpthread /usr/lib64/ /usr/lib64/ /usr/lib64/ 
/usr/bin/ld: /usr/lib64/ undefined reference to `_Py_Mangle'
collect2: error: ld returned 1 exit status
gmake[2]: *** [src/Main/CMakeFiles/FreeCADMain.dir/build.make:135: bin/FreeCAD] Error 1

Which appears to be the reason the build fails.

Comment 2 Miro Hrončok 2021-06-04 20:15:54 UTC
This is a mass-posted update. Sorry if it is not 100% accurate to this bugzilla.

The Python 3.10 rebuild is in progress in a Koji side tag. If you manage to fix the problem, please commit the fix in the rawhide branch, but don't build the package in regular rawhide.

You can either build the package in the side tag, with:

    $ fedpkg build --target=f35-python

Or you can the build and we will eventually build it for you.

Note that the rebuild is still in progress, so not all (build) dependencies of this package might be available right away.


See also

If you have general questions about the rebuild, please use this mailing list thread:

Comment 3 Miro Hrončok 2021-06-07 23:00:15 UTC
The f35-python side tag has been merged to Rawhide. From now on, build as you would normally build.

Comment 4 Miro Hrončok 2021-06-08 10:57:10 UTC

*** This bug has been marked as a duplicate of bug 1902618 ***

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