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

Python module namespace corrupted when using @dataclass on 3.6.6 and PySide2 imported

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Not Evaluated
    • 5.12.2
    • 5.12.1
    • PySide
    • None
    • Linux/X11

    Description

      The attached Python script throws a segmentation fault in the following way:

      • First, QtCore is imported from the PySide2
      • The script has a definition of a class called Foo, decorated with @dataclass.
      • After the Foo is defined, a delayer() function is called which performs some arbitrary work involving programmatic addition of methods to the definition of the class Buzz. Class Buzz is unimportant for this issue, but it is necessary for the delayer() function to perform some work in order for the issue to show.
      • After the delayer() function, when the class Foo is referenced, Python throws a segmentation fault.

      Issue shows with:

      • Python version: 3.6.6
      • Dataclasses version: 0.6

      Issue does not show when either:

      • PySide2 is not imported in the script
      • Foo is not decorated with @dataclass
      • The delayer() function is called with the smaller delay number
      • PySide2 is imported after class Foo has been declared
      • Python 3.7 is used
      • PySide2 5.12.0 is used

       

      Attachments

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

        Activity

          People

            crmaurei Cristian Maureira-Fredes
            bogdanvuk Bogdan Vukobratovic
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes