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

Error when connecting signal to function whose __name__ gets overriden with parentheses

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P4: Low
    • None
    • 6.0, 5.15.7
    • PySide
    • None

    Description

      After a signal is connected to a function whose _name_ gets overriden for whatever reason, the following hard-to-understand error can happen when the signal is emitted:

      TypeError: Can't call meta function because I have no idea how to handle myname

      See example code, which sets the function name to "make_handler(myname)".  If I remove the closing paren, the error becomes "how to handle myname7f64ac794ee0(".  If I remove the opening paren only, no such problem occur.

      I see several problems here:

      • the error message is non-informative
      • the error occuring when the signal is fired, could probably have been detected at connect-time
      • legal messing with a standard python attribute causing unexpected interaction: PySide/Shiboken should probably not interpret this.

      This problem does not occur with PyQt5.

       

      Attachments

        1. pyside1569_stack.txt
          43 kB
        2. pyside1569.py
          1 kB
        3. testpyside-action.py
          0.6 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            crmaurei Cristian Maureira-Fredes
            yann Yann Dirson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes