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

Making methods static that don't need self crashes 5.15.1

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • P2: Important
    • None
    • 5.15.1
    • PySide
    • None
    • Windows

    Description

      So I used the example flowlayout in my project and pylint was suggesting that some of the methods of the layout class may be static since they are not making any use of self inside them.

      See these 2: https://github.com/pyside/pyside2-examples/blob/dev/examples/widgets/layouts/flowlayout.py#L98-L102

      (I guess thisĀ  is not the proper repo but the code is exactly what I mean)

      So I turned these into:

          @staticmethod
          def expandingDirections():
              return QtCore.Qt.Orientations(QtCore.Qt.Orientation(0))
      
          @staticmethod
          def hasHeightForWidth():
              return True
      

      ... and it was fine for 5.15.0! Now I upgraded to the latest 5.15.1 and now my app just goes poof without any warning error .. whatsoever.

      Sure this might be a stupid idea to make these methods static but how do I know?! there does not seem to be anything warning about this in the docs and it should probably not crash like this. Rather with a proper error message, right?

      5.15.1
      SystemError: ../Objects/classobject.c:27: bad argument to internal function
      The above exception was the direct cause of the following exception:
      SystemError: PyEval_EvalFrameEx returned a result with an error set
      SystemError: ../Objects/classobject.c:27: bad argument to internal function
      The above exception was the direct cause of the following exception:
      SystemError: PyEval_EvalFrameEx returned a result with an error set
      

      Attachments

        Issue Links

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

          Activity

            People

              ctismer Christian Tismer
              ewerybody Eric Werner
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes