Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. Debugging TypeError: 'NoneType' object is not callable - debugger won't stop
Forum Updated to NodeBB v4.3 + New Features

Debugging TypeError: 'NoneType' object is not callable - debugger won't stop

Scheduled Pinned Locked Moved Unsolved Qt for Python
3 Posts 2 Posters 887 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    CodeCruncher
    wrote on 4 May 2022, 05:55 last edited by
    #1

    Pure python program using PySide6 with QML.
    Seeing a TypeError: 'NoneType' object is not callable, but trying to figure out WHERE this is occurring is maddening.
    There is no stack trace of file name or line number or any other context clue on where this happening.

    I've setup PyCharm 2022.1 to stop immediately if TypeError is ever raised.
    It stops during main.py startup in unrelated code in the python os.py module once so I know it is setup correctly.
    But it never stops again.

    I'm convinced that TypeError's like this raised from the C code in PySide6 (rather than python code) are not properly visible to the python debugger somehow.

    Can anyone get python debuggers to stop on raised exceptions from the C side of PySide6???

    PySide 6.3.0 w/ Qt 6.3.0 rebuilt from source with debug enabled for source level debugging when it crashes.
    Python 3.8d

    1 Reply Last reply
    0
    • C Offline
      C Offline
      CristianMaureira
      wrote on 4 May 2022, 13:38 last edited by
      #2

      maybe you can share your code as well.

      Typically, when you need to debug the C implementation of things, you need to have a local PySide built using the --debug flag. In case you want to look into the Python internals, you need to have an interpreter with debug symbols as well.
      Then it's just a matter of running gdb --args python your_code.py to get into the C implementation.

      1 Reply Last reply
      0
      • C Offline
        C Offline
        CodeCruncher
        wrote on 4 May 2022, 17:14 last edited by
        #3

        Thanks Cristian. I've done all of that (rebuilt PySide locally w/ debug symbols). I built dist wheels for it that don't include the Qt shared libs and then use the LD_LIBRARY_PATH env variable to have the process load the local debug symbol libs for 6.3.0 I built).

        If the python process just crashes with a segfault, CLion is properly pulling up source and symbols for the C side code.
        But when I run in PyCharm, I cannot get the debugger to stop on this TypeError when its raised. It works for TypeErrors raised from python code. But not from TypeErrors raised by C code apparently which I'm at a loss for.

        I can't post the code because its a huge code base from 5.12 that I've been trying to upgrade to use PySide6 and Qt 6.3. And that's why its so frustrating as this TypeError exception could be from anywhere across ~75 QML files.

        I read about PyErr_Format() which the C code is calling to raise the exception and it appears to be doing the right things so that the debugger should be able to react, but it doesn't work.

        Any other ideas?

        1 Reply Last reply
        0

        1/3

        4 May 2022, 05:55

        • Login

        • Login or register to search.
        1 out of 3
        • First post
          1/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved