Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-1767

Pyside6/Shiboken and ABCMeta Bug

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • 6.7
    • 6.2.2
    • Shiboken
    • None
    • Windows 10, Python 3.9, Pyside 6.2.2.1
    • Windows

    Description

      This is specific to the new Pyside6 package. Pyside2 does not have this issue.

      When attempting to create an abstract class combining JSON and QObject classes Shiboken throws:

      {{ c:\python\python39\lib\abc.py in _new_(mcls, name, bases, namespace, **kwargs) 104 """
      105 def _new_(mcls, name, bases, namespace, **kwargs):
      --> 106 cls = super()._new_(mcls, name, bases, namespace, **kwargs)
      107 _abc_init(cls)
      108 return cls
      TypeError: Shiboken.ObjectType._new(JsonSettingsQtMeta) is not safe, use type.new_()}}

       

      Attaching minimal examples showing the issue. Some duplicated/modified from:
      https://bugreports.qt.io/browse/PYSIDE-1051

      https://stackoverflow.com/questions/66591752/metaclass-conflict-when-trying-to-create-a-python-abstract-class-that-also-subcl

       https://github.com/sausix/python-abcmeta-workaround

      Attachments

        1. Alternate_Class_test.py
          0.5 kB
          David Fitzpatrick
        2. MirageABCMetaBug.py
          0.4 kB
          David Fitzpatrick
        3. test_pyside6_metaclass.py
          3 kB
          Axel Voitier

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              ctismer Christian Tismer
              ashenwake David Fitzpatrick
              Votes:
              4 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes