So it looks like upstream has no intention of supporting Python 3.12 in Pyside2 (5.15.x series), only in Pyside6 which AFAIK requires Qt6.
https://bugreports.qt.io/browse/PYSIDE-2388
Porting is non-trivial and Python upstream does not provide a porting guide.
https://docs.python.org/3/c-api/unicode.html#c.PyUnicode_AS_UNICODE
Says to replace PyUnicode_AS_UNICODE with PyUnicode_nBYTE_DATA which also requires use of the KIND and READY functions.
So now what?
Thanks, Richard
Richard Shaw wrote:
So it looks like upstream has no intention of supporting Python 3.12 in Pyside2 (5.15.x series), only in Pyside6 which AFAIK requires Qt6.
https://bugreports.qt.io/browse/PYSIDE-2388
Porting is non-trivial and Python upstream does not provide a porting guide.
https://docs.python.org/3/c-api/unicode.html#c.PyUnicode_AS_UNICODE
Says to replace PyUnicode_AS_UNICODE with PyUnicode_nBYTE_DATA which also requires use of the KIND and READY functions.
So now what?
Take the patches from https://bugreports.qt.io/browse/PYSIDE-2230 (or from the PySide6 git history if there are changes needed that are not listed there) and backport them.
Try talking to other distros' maintainers to share work.
Kevin Kofler
I was able to work around that error but now hitting the following, and the crumb trail I followed seems to indicate that this needs to be fixed in Qt5, not PySide2[1]
In file included from /builddir/build/BUILD/pyside-setup-opensource-src-5.15.10/redhat-linux-build/sources/pyside2/PySide2/QtGui/PySide2/QtGui/qdragmoveevent_wrapper.cpp:63: /builddir/build/BUILD/pyside-setup-opensource-src-5.15.10/redhat-linux-build/sources/pyside2/PySide2/QtGui/PySide2/QtGui/qdragmoveevent_wrapper.h:55:220: error: no member named 'DragMove' in 'QOpenGLShader'; did you mean simply 'DragMove'? QDragMoveEventWrapper(const QPoint & pos, QFlagsQt::DropAction actions, const QMimeData * data, QFlagsQt::MouseButton buttons, QFlagsQt::KeyboardModifier modifiers, QFlagsQOpenGLShader::ShaderTypeBit type = QOpenGLShader::DragMove);
^~~~~~~~~~~~~~~~~~~~~~~
DragMove /usr/include/qt5/QtCore/qcoreevent.h:107:9: note: 'DragMove' declared here DragMove = 61, // drag moves in widget ^ In file included from /builddir/build/BUILD/pyside-setup-opensource-src-5.15.10/redhat-linux-build/sources/pyside2/PySide2/QtGui/PySide2/QtGui/qdragmoveevent_wrapper.cpp:63: /builddir/build/BUILD/pyside-setup-opensource-src-5.15.10/redhat-linux-build/sources/pyside2/PySide2/QtGui/PySide2/QtGui/qdragmoveevent_wrapper.h:55:213: error: no viable conversion from 'QEvent::Type' to 'QFlagsQOpenGLShader::ShaderTypeBit' QDragMoveEventWrapper(const QPoint & pos, QFlagsQt::DropAction actions, const QMimeData * data, QFlagsQt::MouseButton buttons, QFlagsQt::KeyboardModifier modifiers, QFlagsQOpenGLShader::ShaderTypeBit type = QOpenGLShader::DragMove);
^ ~~~~~~~~ /usr/include/qt5/QtCore/qflags.h:89:7: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'QEvent::Type' to 'const QFlags<ShaderTypeBit> &' for 1st argument class QFlags ^ /usr/include/qt5/QtCore/qflags.h:89:7: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'QEvent::Type' to 'QFlags<ShaderTypeBit> &&' for 1st argument /usr/include/qt5/QtCore/qflags.h:121:29: note: candidate constructor not viable: no known conversion from 'QEvent::Type' to 'QOpenGLShader::ShaderTypeBit' for 1st argument Q_DECL_CONSTEXPR inline QFlags(Enum flags) noexcept : i(Int(flags)) {} ^ /usr/include/qt5/QtCore/qflags.h:123:80: note: candidate constructor not viable: no known conversion from 'QEvent::Type' to 'Zero' (aka 'int (QFlagsQOpenGLShader::ShaderTypeBit::Private::*)') for 1st argument QT_DEPRECATED_X("Use default constructor instead") Q_DECL_CONSTEXPR inline QFlags(Zero) noexcept : i(0) {}
^ /usr/include/qt5/QtCore/qflags.h:125:29: note: candidate constructor not viable: no known conversion from 'QEvent::Type' to 'QFlag' for 1st argument Q_DECL_CONSTEXPR inline QFlags(QFlag flag) noexcept : i(flag) {} ^ /usr/include/qt5/QtCore/qflags.h:127:29: note: candidate constructor not viable: no known conversion from 'QEvent::Type' to 'std::initializer_list<ShaderTypeBit>' for 1st argument Q_DECL_CONSTEXPR inline QFlags(std::initializer_list<Enum> flags) noexcept ^ /builddir/build/BUILD/pyside-setup-opensource-src-5.15.10/redhat-linux-build/sources/pyside2/PySide2/QtGui/PySide2/QtGui/qdragmoveevent_wrapper.h:55:213: note: passing argument to parameter 'type' here QDragMoveEventWrapper(const QPoint & pos, QFlagsQt::DropAction actions, const QMimeData * data, QFlagsQt::MouseButton buttons, QFlagsQt::KeyboardModifier modifiers, QFlagsQOpenGLShader::ShaderTypeBit type = QOpenGLShader::DragMove);
^ /builddir/build/BUILD/pyside-setup-opensource-src-5.15.10/redhat-linux-build/sources/pyside2/PySide2/QtGui/PySide2/QtGui/qdragmoveevent_wrapper.cpp:103:240: error: no matching constructor for initialization of 'QDragMoveEvent' QDragMoveEventWrapper::QDragMoveEventWrapper(const QPoint & pos, QFlagsQt::DropAction actions, const QMimeData * data, QFlagsQt::MouseButton buttons, QFlagsQt::KeyboardModifier modifiers, QFlagsQOpenGLShader::ShaderTypeBit type) : QDragMoveEvent(pos, actions, data, buttons, modifiers, type)
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/qt5/QtGui/qevent.h:684:5: note: candidate constructor not viable: no known conversion from 'QFlagsQOpenGLShader::ShaderTypeBit' to 'Type' for 6th argument QDragMoveEvent(const QPoint &pos, Qt::DropActions actions, const QMimeData *data,
In the OpenMandriva package they have the following: # FIXME This patch is completely meaningless in the context of C++. # It is a workaround for a pyside2 build failure with Qt 5.15.9, # pyside2 5.15.9, clang 16.0.1 -- the generated code thinks a # not otherwise specified "Type" is in fact a # QFlagsQOpenGLShader::ShaderTypeBit, causing many functions # looking for a QEvent::Type to be bogus. # Since there are no side effects to superfluously specifying # QEvent::Type instead of plain "Type" in a QEvent derived class, # this workaround is acceptable, if not nice. Patch5: qtbase-5.15.9-work-around-pyside2-brokenness.patch
Thanks, Richard
[1] https://github.com/OpenMandrivaAssociation/qt5-qtbase/blob/master/qtbase-5.1...
Richard Shaw wrote:
# FIXME This patch is completely meaningless in the context of C++. # It is a workaround for a pyside2 build failure with Qt 5.15.9, # pyside2 5.15.9, clang 16.0.1 -- the generated code thinks a # not otherwise specified "Type" is in fact a # QFlagsQOpenGLShader::ShaderTypeBit, causing many functions # looking for a QEvent::Type to be bogus. # Since there are no side effects to superfluously specifying # QEvent::Type instead of plain "Type" in a QEvent derived class, # this workaround is acceptable, if not nice. Patch5: qtbase-5.15.9-work-around-pyside2-brokenness.patch
[snip]
[1] https://github.com/OpenMandrivaAssociation/qt5-qtbase/blob/master/qtbase-5.1...
I think we can apply this, the extra disambiguation should not hurt indeed.
Kevin Kofler
On Thu, Jul 13, 2023 at 5:10 PM Kevin Kofler via devel < devel@lists.fedoraproject.org> wrote:
Richard Shaw wrote:
# FIXME This patch is completely meaningless in the context of C++. # It is a workaround for a pyside2 build failure with Qt 5.15.9, # pyside2 5.15.9, clang 16.0.1 -- the generated code thinks a # not otherwise specified "Type" is in fact a # QFlagsQOpenGLShader::ShaderTypeBit, causing many functions # looking for a QEvent::Type to be bogus. # Since there are no side effects to superfluously specifying # QEvent::Type instead of plain "Type" in a QEvent derived class, # this workaround is acceptable, if not nice. Patch5: qtbase-5.15.9-work-around-pyside2-brokenness.patch
[snip]
[1]
https://github.com/OpenMandrivaAssociation/qt5-qtbase/blob/master/qtbase-5.1...
I think we can apply this, the extra disambiguation should not hurt indeed.
Any progress on this? I can submit a BZ ticket for tracking if needed.
Thanks, Richard